Skip to content

Instantly share code, notes, and snippets.

@Athosone
Created September 19, 2018 14:00
Show Gist options
  • Save Athosone/14bbd1e970576ab39ed3b0a2478501ac to your computer and use it in GitHub Desktop.
Save Athosone/14bbd1e970576ab39ed3b0a2478501ac to your computer and use it in GitHub Desktop.
Curry function
func curry<A, B, C>(_ fn: @escaping (A, B) -> C) -> (A) -> (B) -> C {
return { (a: A) in
return { (b: B) in
return fn(a, b)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment