Skip to content

Instantly share code, notes, and snippets.

@jjant
Created June 14, 2018 02:07
Show Gist options
  • Save jjant/ef99a5575c6465e8cc9f5ce7135af3b8 to your computer and use it in GitHub Desktop.
Save jjant/ef99a5575c6465e8cc9f5ce7135af3b8 to your computer and use it in GitHub Desktop.
instance Monad (Cont r) where
return x = Cont (\k -> k x)
-- (>>=) :: Cont r a -> (a -> Cont r b) -> Cont r b
(Cont c) >>= f = Cont $ \k -> c (\x -> runCont (f x) k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment