TypeCompose-0.9.8: Type composition classes & instances

Portabilityportable
Stabilityexperimental
Maintainerconal@conal.net
Safe HaskellNone

Data.Title

Description

Generic titling (labeling).

Synopsis

Documentation

class Title u whereSource

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 -> uSource

Instances

Title String 
Title_f f => Title (f a) 
Title a => Title (CxMonoid a) 
Title b => Title (a -> b) 

class Title_f f whereSource

Methods

title_f :: String -> f a -> f aSource

title for all applications of f

Instances

Title_f IO 
Title o => Title_f (Flip (->) o) 
Title_f g => Title_f (:. g f)