|ProbabilityMonads-0.1.0: Probability distribution monads.||Contents||Index|
|Portability||non-portable (multi-parameter type classes, undecidable instances)|
This module provides stripped-down versions of
Writer and WriterT, minus the
operations tell, listen and
pass. It a useful building block for monads
representing probability distributions or quantum states, where the extra
functions provided by MonadWriter are
irrelevant or inappropriate.
The MV monad and the MVT monad transformer were proposed by Dan Piponi
as a way of representing M-sets in Haskell. An M-set is a set with a
monoid action (by analogy to the more common G-sets found in group theory).
Here, MV represents an element in a free M-set. This is essentially a
- Computation type:
- Computations with an associated monoid action.
- Binding strategy:
- The return function lifts a value into the monad by
pairing it with mempty. The bind function uses mappend to implement
the monoid action.
- Useful for:
- Building probability distribution monads.
|data MV w a|
|A value annotated with a monoid. Represents an element in a free
|mvMonoid :: w|
|mvValue :: a|
|mvMonoid :: MV w a -> w|
|mvValue :: MV w a -> a|
|newtype MVT w m a|
|Transforms a monad m to associate a monoid value with the
|runMVT :: MVT w m a -> m (MV w a)|
|Produced by Haddock version 0.8|