Skip to content

Instantly share code, notes, and snippets.

@xaviervia
Created March 19, 2017 20:38
Show Gist options
  • Save xaviervia/416cf198c8f185d69bc98a19a6f1a8f4 to your computer and use it in GitHub Desktop.
Save xaviervia/416cf198c8f185d69bc98a19a6f1a8f4 to your computer and use it in GitHub Desktop.
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