Skip to content

Instantly share code, notes, and snippets.

@akiradeveloper
Created August 11, 2011 13:15
Show Gist options
  • Save akiradeveloper/1139614 to your computer and use it in GitHub Desktop.
Save akiradeveloper/1139614 to your computer and use it in GitHub Desktop.
The power of Applicative Functor
Prelude Control.Applicative> let x = (++) <$> getLine <*> getLine
Prelude Control.Applicative> x
akira
developer
"akiradeveloper"
@akiradeveloper
Copy link
Author

This is also the power of Applicative.

Prelude Control.Applicative> liftA2 (^) <$> [Just 1] <*> [Nothing, Just 2]
[Nothing,Just 1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment