Skip to content

Instantly share code, notes, and snippets.

@hrldcpr
Created July 31, 2014 14:50
Show Gist options
  • Save hrldcpr/5e7d1157b8ba6f53d8d7 to your computer and use it in GitHub Desktop.
Save hrldcpr/5e7d1157b8ba6f53d8d7 to your computer and use it in GitHub Desktop.
three different implementations of liftM
liftM f m = m >>= (return . f)
liftM f m = do
a <- m
return (f a)
-- which is just sugar for:
liftM f m =
m >>= \a ->
return (f a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment