Skip to content

Instantly share code, notes, and snippets.

@dewey92
Created June 23, 2017 22:28
Show Gist options
  • Select an option

  • Save dewey92/ffb4c53b34164796554832d5684d5424 to your computer and use it in GitHub Desktop.

Select an option

Save dewey92/ffb4c53b34164796554832d5684d5424 to your computer and use it in GitHub Desktop.
const incr = x => x + 1
const add = curry((x, y) => x + y)
const sum3 = curry((x, y, z) => x + y + z)
liftA(incr, Functor1) === pure(incr).ap(Functor1)
liftA2(add, Functor1, Functor2) === pure(add).ap(Functor1).ap(Functor2)
liftA3(sum3, Functor1, Functor2, Functor3) === pure(sum3).ap(Functor1).ap(Functor2).ap(Functor3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment