ST +Control.Monad +mtl
Strict RWS monad.
Inspired by the paper Functional Programming with Overloading and Higher-Order Polymorphism, Mark P Jones (http://web.cecs.pdx.edu/~mpj/) Advanced School of Functional Programming, 1995.
State monads.
This module is inspired by the paper Functional Programming with Overloading and Higher-Order Polymorphism, Mark P Jones (http://web.cecs.pdx.edu/~mpj/) Advanced School of Functional Programming, 1995.
Strict state monads.
This module is inspired by the paper Functional Programming with Overloading and Higher-Order Polymorphism, Mark P Jones (http://web.cecs.pdx.edu/~mpj/) Advanced School of Functional Programming, 1995.
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.
The List monad.
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
listens f m is an action that executes the action m and adds the result of applying f to the output to the value of the computation.
* f m = liftM (id *** f) (listen
>
Map the inner computation using the given function.
* (mapRWST f m) r s = f (runRWST m
> r
Show more results