JsonGrammar-0.1: Combinators for bidirectional JSON parsing

Data.Iso.TH

Synopsis

Documentation

deriveIsos :: 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 :: Iso t (Maybe a :- t)
 just    :: Iso (a :- t) (Maybe a :- t)
 (nothing, just) = $(deriveIsos ''Maybe)

Deriving isomorphisms this way requires -XNoMonoPatBinds.