Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newtype StateT s m a = StateT {runStateT :: (s -> m (a,s)) }
- instance (Monad m) => Monad (StateT s m) where
- return a = StateT $ \s -> return (a,s)
- (StateT x) >>= f = \s ->
- do (a,s') <- runStateT x;
- (f a, s');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement