ST +Control.Monad +transformers
A monad transformer that combines ReaderT, WriterT and StateT. This version is strict; for a lazy version, see Control.Monad.Trans.RWS.Lazy, which has the same interface.
Strict state monads, passing an updatable state through a computation. See below for examples.
In this version, sequencing of computations is strict. For a lazy version, see Control.Monad.Trans.State.Lazy, which has the same interface.
Some computations may not require the full power of state transformers:
* For a read-only state, see Control.Monad.Trans.Reader.
* To accumulate a value without using it on the way, see Control.Monad.Trans.Writer.
The strict WriterT monad transformer, which adds collection of outputs (such as a count or string output) to a given monad.
This version builds its output strictly; for a lazy version, see Control.Monad.Trans.Writer.Lazy, which has the same interface.
This monad transformer provides only limited access to the output during the computation. For more general access, use Control.Monad.Trans.State instead.
A state monad parameterized by the type s of the state to carry.
The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.
Construct a state monad computation from a state transformer function.
Construct a state monad computation from a function. (The inverse of runState.)
A state transformer monad parameterized by:
* s - The state.
* m - The inner monad.
The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.
The ListT monad transformer, adding backtracking to a given monad, which must be commutative.
Workaround so that we can have a Haskell 98 instance Error String.
Evaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.
Evaluate a state computation with the given initial state and return the final value, discarding the final state.
* m s = fst (runState m
>
Evaluate a state computation with the given initial state and return the final value, discarding the final state.
* m s = liftM fst
> (runStateT m
Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.
Evaluate a state computation with the given initial state and return the final state, discarding the final value.
* m s = snd (runState m
>
Evaluate a state computation with the given initial state and return the final state, discarding the final value.
* m s = liftM snd
> (runStateT m
Lift a listen operation to the new monad.
Lift a listen operation to the new monad.
Show more results