TypeCompose-0.9.12: Type composition classes & instances

Copyright(c) Conal Elliott 2007
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Data.Title

Description

Generic titling (labeling).

Synopsis

Documentation

class Title u where Source #

Provide a title on a value. If you can title polymorphically, please instantiate Title_f instead of Title. Then you'll automatically get a Title for each type instance, thanks to this rule.

  instance Title_f f => Title (f a) where title = title_f

To handle ambiguity for types like ([] Char) -- aka String, this module is compiled with OverlappingInstances and UndecidableInstances. The more specific instance (yours) wins.

In defining your instance, you might want to use the String instance, e.g., title ttl "".

Minimal complete definition

title

Methods

title :: String -> u -> u Source #

Instances

Title String Source # 

Methods

title :: String -> String -> String Source #

Title_f f => Title (f a) Source # 

Methods

title :: String -> f a -> f a Source #

Title a => Title (CxMonoid a) Source # 

Methods

title :: String -> CxMonoid a -> CxMonoid a Source #

Title b => Title (a -> b) Source # 

Methods

title :: String -> (a -> b) -> a -> b Source #

class Title_f f where Source #

Minimal complete definition

title_f

Methods

title_f :: String -> f a -> f a Source #

title for all applications of f

Instances

Title_f IO Source # 

Methods

title_f :: String -> IO a -> IO a Source #

Title o => Title_f (Flip (->) o) Source # 

Methods

title_f :: String -> Flip (->) o a -> Flip (->) o a Source #

Title_f g => Title_f ((:.) g f) Source # 

Methods

title_f :: String -> (g :. f) a -> (g :. f) a Source #