Module State

This library provides an implementation of the state monad.

Author: Jan-Hendrik Matthes, Bjoern Peemoeller, Fabian Skrlac

Version: August 2016

Summary of exported operations:

bindS :: (a -> (b,a)) -> (b -> a -> (c,a)) -> a -> (c,a)   
bindS_ :: (a -> (b,a)) -> (a -> (c,a)) -> a -> (c,a)   
returnS :: a -> b -> (a,b)   
getS :: a -> (a,a)   
putS :: a -> a -> ((),a)   
modifyS :: (a -> a) -> a -> ((),a)   
sequenceS :: [a -> (b,a)] -> a -> ([b],a)   
sequenceS_ :: [a -> (b,a)] -> a -> ((),a)   
mapS :: (a -> b -> (c,b)) -> [a] -> b -> ([c],b)   
mapS_ :: (a -> b -> (c,b)) -> [a] -> b -> ((),b)   
runState :: (a -> (b,a)) -> a -> (b,a)   
evalState :: (a -> (b,a)) -> a -> b   
execState :: (a -> (b,a)) -> a -> a   
liftS :: (a -> b) -> (c -> (a,c)) -> c -> (b,c)   
liftS2 :: (a -> b -> c) -> (d -> (a,d)) -> (d -> (b,d)) -> d -> (c,d)   

Exported datatypes:


State

Type synonym: State a b = a -> (b,a)


Exported operations:

bindS :: (a -> (b,a)) -> (b -> a -> (c,a)) -> a -> (c,a)   

Further infos:
  • defined as left-associative infix operator with precedence 1

bindS_ :: (a -> (b,a)) -> (a -> (c,a)) -> a -> (c,a)   

Further infos:
  • defined as left-associative infix operator with precedence 1

returnS :: a -> b -> (a,b)   

Further infos:
  • solution complete, i.e., able to compute all solutions

getS :: a -> (a,a)   

Further infos:
  • solution complete, i.e., able to compute all solutions

putS :: a -> a -> ((),a)   

Further infos:
  • solution complete, i.e., able to compute all solutions

modifyS :: (a -> a) -> a -> ((),a)   

sequenceS :: [a -> (b,a)] -> a -> ([b],a)   

sequenceS_ :: [a -> (b,a)] -> a -> ((),a)   

mapS :: (a -> b -> (c,b)) -> [a] -> b -> ([c],b)   

mapS_ :: (a -> b -> (c,b)) -> [a] -> b -> ((),b)   

runState :: (a -> (b,a)) -> a -> (b,a)   

evalState :: (a -> (b,a)) -> a -> b   

execState :: (a -> (b,a)) -> a -> a   

liftS :: (a -> b) -> (c -> (a,c)) -> c -> (b,c)   

liftS2 :: (a -> b -> c) -> (d -> (a,d)) -> (d -> (b,d)) -> d -> (c,d)