**Packages**- mtl
- transformers
- GLUT
- HUnit
- parsec

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.

State monads, passing an updatable state through a computation.
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.
This version is lazy; for a strict version, see Control.Monad.Trans.State.Strict, which has the same interface.

GLUT maintains a considerable amount of programmer visible state. Some (but not all) of this state may be directly retrieved.

Keeps track of the remaining tests and the results of the performed tests. As each test is performed, the path is removed and the counts are updated as appropriate.

State represents QuickCheck's internal state while testing a property. The state is made visible to callback functions.

transformers Control.Monad.Trans.State.Lazy, transformers Control.Monad.Trans.State.Strict, mtl Control.Monad.State.Lazy, mtl Control.Monad.State.Strict

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.

State variables are references in the IO monad, like IORefs or parts of the OpenGL state. Note that state variables are not neccessarily writable or readable, they may come in read-only or write-only flavours, too. As a very simple example for a state variable, consider an explicitly allocated memory buffer. This buffer can easily be converted into a StateVar:
> makeStateVarFromPtr :: Storable a => Ptr a -> StateVar a
> makeStateVarFromPtr p = makeStateVar (peek p) (poke p)
The example below puts 11 into a state variable (i.e. into the buffer), increments the contents of the state variable by 22, and finally prints the resulting content:
> do p <- malloc :: IO (Ptr Int)
> let v = makeStateVarFromPtr p
> v $= 11
> v $~ (+ 22)
> x <- get v
> print x
IORefs are state variables, too, so an example with them looks extremely similiar:
> do v <- newIORef (0 :: Int)
> v $= 11
> v $~ (+ 22)
> x <- get v
> print x

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.

A concrete implementation of a readable and writable state variable, carrying one IO action to read the value and another IO action to write the new value.

This package contains state variables, which are references in the IO monad, like IORefs or parts of the OpenGL state.
Version 1.0.0.0

Construct a state monad computation from a state transformer function.

Construct a state monad computation from a function. (The inverse of runState.)

Data.State
Version 0.1