Created
March 19, 2017 20:38
-
-
Save xaviervia/416cf198c8f185d69bc98a19a6f1a8f4 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
map => f => match([ | |
Nil: () => Nil.of() | |
Cons: ([x, xs]) => Cons.of([f(x), map(f)(xs)]) | |
}) | |
match({ | |
Z: Z.of, | |
S: match({ | |
Z: Z.of, | |
S: match({ | |
Z: () => 'hurray', | |
S: Z.of | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment