Skip to content

Instantly share code, notes, and snippets.

@pimeys
Created October 28, 2014 18:12
Show Gist options
  • Save pimeys/35a3a8708dcc85cf2684 to your computer and use it in GitHub Desktop.
Save pimeys/35a3a8708dcc85cf2684 to your computer and use it in GitHub Desktop.
def curry[A, B, C](f: (A, B) => C): A => (B => C) =
(a: A) => (b: B) => f(a, b)
def uncurry[A, B, C](f: A => B => C): (A, B) => C =
(a: A, b: B) => f(a)(b)
def compose[A, B, C](f: B => C, g: A => B): A => C =
(a: A) => f(g(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment