1 implementation module StdStateMonad
5 :: ST s a = ST (s -> (a, s))
7 instance return (ST s) where return x = ST (\w = (x, w))
8 instance >>= (ST s) where >>= (ST f) g = ST (\w = let (a, w1) = f w
12 mkST :: (s -> (a,s)) -> ST s a
15 unST :: (ST s a) -> s -> (a, s)