State

module Control.Monad.State
mtl Control.Monad.State
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.
module Control.Monad.Trans.State
transformers Control.Monad.Trans.State
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.
module Graphics.UI.GLUT.State
GLUT Graphics.UI.GLUT.State
GLUT maintains a considerable amount of programmer visible state. Some (but not all) of this state may be directly retrieved.
State :: Path -> Counts -> State
HUnit Test.HUnit.Base
State :: s -> SourcePos -> u -> State s u
parsec Text.Parsec.Prim, parsec Text.ParserCombinators.Parsec.Prim
data State
HUnit Test.HUnit.Base
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.
data State
QuickCheck Test.QuickCheck.State
State represents QuickCheck's internal state while testing a property. The state is made visible to callback functions.
data State s u
parsec Text.Parsec.Prim, parsec Text.ParserCombinators.Parsec.Prim
type State s = StateT s Identity
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.
module Test.QuickCheck.State
QuickCheck Test.QuickCheck.State
module Graphics.Rendering.OpenGL.GL.StateVar
OpenGL Graphics.Rendering.OpenGL.GL.StateVar
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
StateT :: (s -> m (a, s)) -> StateT s a
mtl Control.Monad.State.Lazy, mtl Control.Monad.State.Strict
StateT :: (s -> m (a, s)) -> StateT s m a
transformers Control.Monad.Trans.State.Lazy, transformers Control.Monad.Trans.State.Strict
newtype StateT s m a
transformers Control.Monad.Trans.State.Lazy, transformers Control.Monad.Trans.State.Strict
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.
data StateVar a
OpenGL Graphics.Rendering.OpenGL.GL.StateVar
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.
package StateVar
package
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
state :: (Monoid w, Monad m) => (s -> (a, s)) -> RWST r w s m a
transformers Control.Monad.Trans.RWS.Lazy, transformers Control.Monad.Trans.RWS.Strict
Construct a state monad computation from a state transformer function.
state :: Monad m => (s -> (a, s)) -> StateT s m a
transformers Control.Monad.Trans.State.Lazy, transformers Control.Monad.Trans.State.Strict
Construct a state monad computation from a function. (The inverse of runState.)
state :: MonadState s m => (s -> (a, s)) -> m a
mtl Control.Monad.State.Class, mtl Control.Monad.State.Lazy, mtl Control.Monad.State.Strict
package state
package
Data.State Version 0.1

Show more results