Last active
June 27, 2017 05:36
-
-
Save dewey92/9d813de92f5b95bfc46d0eddda13cb0a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // pure :: Applicative f => a → f a | |
| const pure = a => Functor.of(a) | |
| // ap :: Applicative f => f (a → b) → f a → f b | |
| const ap = (functor1, functor2) => functor1.ap(functor2) | |
| // liftA :: Applicative f => (a → b) → f a → f b | |
| const liftA = (fn, functor1) => functor1.map(fn) | |
| // liftA2 :: Applicative f => (a → b → c) → f a → f b → f c | |
| const liftA2 = (fn, functor1, functor2) => ap(functor1.map(fn), functor2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment