Created
September 19, 2018 14:00
-
-
Save Athosone/14bbd1e970576ab39ed3b0a2478501ac to your computer and use it in GitHub Desktop.
Curry function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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