Skip to content

Instantly share code, notes, and snippets.

@bitemyapp
Forked from YoEight/State.hs
Last active August 29, 2015 14:07
Show Gist options
  • Save bitemyapp/5deea2704910e0cb531d to your computer and use it in GitHub Desktop.
Save bitemyapp/5deea2704910e0cb531d to your computer and use it in GitHub Desktop.
{-# LANGUAGE RankNTypes #-}
newtype State s a = State { runState :: forall r. s -> (a -> s -> r) -> r }
stateReturn :: a -> State s a
stateReturn = undefined
stateMap :: (a -> b) -> State s a -> State s b
stateMap = undefined
stateBind :: (a -> State s b) -> State s a -> State s b
stateBind = undefined
stateGet :: State s s
stateGet = undefined
statePut :: s -> State s ()
statePut = undefined
stateModify :: (s -> s) -> State s ()
stateModify = undefined
execState :: s -> State s a -> s
execState = undefined
evalState :: s -> State s a -> a
evalState = undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment