Piso-0.1: Partial isomorphisms

Safe HaskellNone

Data.Piso.TH

Synopsis

Documentation

derivePisos :: Name -> Q ExpSource

Derive partial isomorphisms for a given datatype. The resulting expression is a tuple with one isomorphism element for each constructor in the datatype.

For example:

 nothing :: Piso t (Maybe a :- t)
 just    :: Piso (a :- t) (Maybe a :- t)
 (nothing, just) = $(derivePisos ''Maybe)

Deriving isomorphisms this way requires -XNoMonoPatBinds.