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

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 Source #

Our fixed state monad

Constructors

State 

Fields

Instances

Monad (State s) Source # 

Methods

(>>=) :: State s a -> (a -> State s b) -> State s b

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

return :: a -> State s a

fail :: String -> State s a

Functor (State s) Source # 

Methods

fmap :: (a -> b) -> State s a -> State s b

(<$) :: a -> State s b -> State s a

Applicative (State s) Source # 

Methods

pure :: a -> State s a

(<*>) :: State s (a -> b) -> State s a -> State s b

(*>) :: State s a -> State s b -> State s b

(<*) :: State s a -> State s b -> State s a

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

get :: State s s Source #

put :: s -> State s () Source #

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

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

evalState :: State s a -> s -> a Source #

execState :: State s a -> s -> s Source #

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

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