TypeCompose-0.9.14: 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 "".

Methods

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

Instances
Title String Source # 
Instance details

Defined in Data.Title

Methods

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

Title_f f => Title (f a) Source # 
Instance details

Defined in Data.Title

Methods

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

Title a => Title (CxMonoid a) Source # 
Instance details

Defined in Data.CxMonoid

Methods

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

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

Defined in Data.Title

Methods

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

class Title_f f where Source #

Methods

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

title for all applications of f

Instances
Title_f IO Source # 
Instance details

Defined in Data.Title

Methods

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

Title o => Title_f (Flip ((->) :: Type -> Type -> Type) o) Source # 
Instance details

Defined in Data.Title

Methods

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

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

Defined in Data.Title

Methods

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