Skip to content

Commit

Permalink
Add new State test to the doctest too
Browse files Browse the repository at this point in the history
  • Loading branch information
gwils committed Oct 28, 2019
1 parent 2040aed commit 2124185
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Course/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ instance Applicative (State s) where
--
-- >>> let modify f = State (\s -> ((), f s)) in runState (modify (+1) >>= \() -> modify (*2)) 7
-- ((),16)
--
-- >>> runState ((\a -> State (\s -> (a + s, 10 + s))) =<< State (\s -> (s * 2, 4 + s))) 2
-- (10,16)
instance Monad (State s) where
(=<<) ::
(a -> State s b)
Expand Down

0 comments on commit 2124185

Please sign in to comment.