Created
April 8, 2019 20:56
-
-
Save dubzzz/527c0d0eaa49759a83f9d2fd4bf6b1c5 to your computer and use it in GitHub Desktop.
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
export const map2 = function<UU extends URIS>(functor: Apply1<UU>) { | |
return function< | |
TypeUUA extends Type<UU, any>, | |
TypeUUB extends Type<UU, any>, | |
R | |
>( | |
fa: TypeUUA, fb: TypeUUB, f: (a: TypeUUA['_A'], b: TypeUUB['_A']) => R): Type<UU, R> { | |
return functor.ap( | |
functor.map( | |
fa, | |
a => (b: TypeUUB['_A']) => f(a, b) | |
), | |
fb, | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment