TypeCompose-0.9.11: 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 
Title_f f => Title (f a) Source 
Title a => Title (CxMonoid a) Source 
Title b => Title (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