Skip to content

Instantly share code, notes, and snippets.

@tarquin-the-brave
Created May 12, 2020 13:33
Show Gist options
  • Save tarquin-the-brave/e9db0562d02672f4300cec9f7d2ee410 to your computer and use it in GitHub Desktop.
Save tarquin-the-brave/e9db0562d02672f4300cec9f7d2ee410 to your computer and use it in GitHub Desktop.
instance Monad Prog where
return = Running
(Crashed e) >>= _ = (Crashed e)
(End prog) >>= k = k prog
(Running prog) >>= k = k prog
(AwaitInput prog) >>= k = k prog
instance MonadFail Prog where
fail = Crashed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment