Created
April 3, 2014 08:42
-
-
Save dripolles/9950705 to your computer and use it in GitHub Desktop.
1HaskellADay 2014/04/03
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
import Control.Applicative | |
import Control.Arrow | |
foo :: (a -> b) -> [a] -> [(a,b)] | |
foo f = map ((,) <$> id <*> f) | |
foo' :: (a -> b) -> [a] -> [(a,b)] | |
foo' = map . (id &&&) | |
main = do | |
print $ foo (>1) [0..4] | |
print $ foo' (>1) [0..4] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment