Hets - the Heterogeneous Tool Set

CopyrightC. Maeder and Uni Bremen 2002-2005
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerChristian.Maeder@dfki.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred

Common.Lib.State

Description

State type from Control.Monad.State but no class MonadState

This module was a replacement of the (non-haskell98) module Control.Monad.State, but now Control.Monad.Trans.State can be used instead.

Synopsis

Documentation

newtype State s a

Our fixed state monad

Constructors

State 

Fields

runState :: s -> (a, s)
 

Instances

state :: (s -> (a, s)) -> State s a

get :: State s s

put :: s -> State s ()

modify :: (s -> s) -> State s ()

gets :: (s -> a) -> State s a

evalState :: State s a -> s -> a

execState :: State s a -> s -> s

mapState :: ((a, s) -> (b, s)) -> State s a -> State s b

withState :: (s -> s) -> State s a -> State s a