After reading a couple of tutorials on Haskell state monads I wanted to try them out myself. The tutorials I read claim that the Control.Monad.State provide the following defini
A while ago the MTL switched from
newtype State s a = State ...
to
type State s = StateT s Identity
since otherwise we had to duplicate the logic for every monad and its transformer. Instead you can now use the state
function
state :: (s -> (a, s)) -> State s a
Sadly, RWH and LYAH both are out of date in this respect :(