Piso-0.2: Partial isomorphisms

Safe HaskellNone
LanguageHaskell98

Data.Piso.TH

Synopsis

Documentation

derivePisos :: Name -> Q Exp Source #

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.