PFP Laboratory 8

From Marek Běhálek Wiki
Revision as of 08:11, 24 October 2022 by Beh01 (talk | contribs) (Created page with "== Monads == * Consider you have a type: <syntaxhighlight lang="Haskell"> newtype State s a = State { runState :: s -> (s, a) } </syntaxhighlight> Make this type the instance...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Monads

  • Consider you have a type:
newtype State s a = State { runState :: s -> (s, a) }

Make this type the instance of Monad