MonadLab-0.0.2: Automatically generate layered monadsSource codeContentsIndex
mkMonad :: MonadName -> [Layer] -> Q [Dec]
data Layer
= Io
| List
| ErrorT ErrorName TypeQ
| StateT StateName TypeQ
| EnvT EnvName TypeQ
| WriterT WriterName TypeQ
| ContT TypeQ
| ResT MonadName
errorTRec :: String -> String -> Layer
stateTRec :: String -> String -> Layer
envTRec :: String -> String -> Layer
writerTRec :: String -> String -> Layer
contTRec :: String -> Layer
mkMonad :: MonadName -> [Layer] -> Q [Dec]Source
data Layer Source
The Layer data type. A monad is constructed from a list of layers. Each layer adds a corresponding set of non-proper morphisms (npms) for use in the monad. The non-proper morphisms can be thought of as the interface of the monad or primitives in the constructed monad "language".
IoThe Io layer. Adds an npm for IO operations.
ListThe List layer. Adds an npm for expressing nondeterministic computation.
ErrorT ErrorName TypeQThe Error (or Exception) layer. Adds npms for exception throwing/handling.
StateT StateName TypeQThe State layer. Adds npms for the manipulation of a mutable state.
EnvT EnvName TypeQThe Environment layer. Adds npms for reading/pre-setting an immutable environment.
WriterT WriterName TypeQThe Writer layer. Adds npms for the production/manipulation of sequenced output.
ContT TypeQThe Continuation layer. f no List layer is included in the li , then the corresponding Layer transformers are composed Adds an npm for accessing current continuation to facilate continuation passing style programming.
ResT MonadNameThe Resumption layer.
errorTRec :: String -> String -> LayerSource
stateTRec :: String -> String -> LayerSource
envTRec :: String -> String -> LayerSource
writerTRec :: String -> String -> LayerSource
contTRec :: String -> LayerSource
Produced by Haddock version 2.4.2