hofix-mtl-1.0: defining @mtl@-ready monads as * -> * fixed-points

Portabilitysee LANGUAGE pragmas
Stabilityexperimental
Maintainernicolas.frisby@gmail.com

Data.StarToStar.Iso.TH

Description

A template haskell definition for automatically generating the instance for Data.StarToStar.Iso.Iso. For example:

 decl_fix "ReaderST" ["s"] [t| ReaderT (Map String ($me Int) (ST $(tvar "s")) |]

generates

 newtype ReaderST s me a = ReaderST (ReaderT (Map String (me Int)) (ST s) a)
 unReaderST (ReaderST x) = x
 type ReaderST_inner s me = ReaderT (Map String (me Int)) (ST s)
 instance Iso (Fix (ReaderST s)) where
   type Other (Fix (ReaderST s)) = ReaderST_inner s (Fix (ReaderST s))
   from = unReaderST . fromFix
   to = toFix . ReaderST

Documentation