Last active
August 29, 2015 14:02
-
-
Save elm4ward/f040a1169fee53c916e5 to your computer and use it in GitHub Desktop.
This file contains 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
// Current state of curry and partial application in Swift | |
// go | |
func adder1(a:Int)(b:Int) -> Int { | |
return a + b | |
} | |
let adder2 = {(a: Int, b: Int) -> Int in | |
return a + b; | |
} | |
let adder3 = {(a: Int) -> (Int -> Int) in | |
return {(b: Int) -> Int in | |
return a + b; | |
}; | |
} | |
adder1(5)(b:10) | |
adder2(5, 10) | |
adder3(5)(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment