The Haskell Wiki   MonadTemplateLibrary UserPreferences
 
HelpContents Search Diffs Info Edit Subscribe XML Print View

A library of useful and highly parameterized monads and written by AndyGill.

The monads include:

All monads in the MonadTemplateLibrary (except the IdentityMonad) have associated MonadTransformers.


...but why have non-transformer monads? All MonadTransformers can be un-transformed with the IdentityMonad -- e.g.:

type State s a = StateT s Identity a 

--Riastradh

Potentially efficiency, and (slight) convenience unless the library provides both. If the library provides both then how it's implemented hardly matters, if it doesn't then to use State, you'd have to runIdentity . flip runStateT state and for the list transformer you couldn't just use [a] you'd have to have ListT Identity a. Nevertheless, a new Control.Monad.* library being developed does define everything in terms of MonadTransformers. So long story short quite often you just want an untransformed monad and any decent library should transparently provide it, it's an implementation issue on how it's, well, implemented.

-- Derek Elkins

Some related classes...

Currently distributed along with the GlasgowHaskellCompiler. Maybe it should be included in HaskellTwo.


CategoryMonad
PythonPowered
EditText of this page (last modified 2003-06-24 00:36:58)
FindPage by browsing, title search , text search or an index
Or try one of these actions: LikePages, LocalSiteMap, SpellCheck