Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Created March 6, 2012 23:37
Show Gist options
  • Save diegopacheco/1989797 to your computer and use it in GitHub Desktop.
Save diegopacheco/1989797 to your computer and use it in GitHub Desktop.
Haskell Monad
class Monad m where
return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
x >> y = x >>= \_ -> y
fail :: String -> m a
fail msg = error msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment