Skip to content

Instantly share code, notes, and snippets.

@RyanCCollins
Last active June 30, 2017 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanCCollins/e3c57eb9a96ed66344b554b1c9fe1a22 to your computer and use it in GitHub Desktop.
Save RyanCCollins/e3c57eb9a96ed66344b554b1c9fe1a22 to your computer and use it in GitHub Desktop.
Swift currying
func curried(_ f: @escaping (_: Int, _: Int) -> Int) -> (_: Int) -> (_: Int) -> Int {
return { a in { b in f(a, b) }}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment