Created
July 31, 2014 14:50
-
-
Save hrldcpr/5e7d1157b8ba6f53d8d7 to your computer and use it in GitHub Desktop.
three different implementations of liftM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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