Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save elm4ward/f040a1169fee53c916e5 to your computer and use it in GitHub Desktop.
Save elm4ward/f040a1169fee53c916e5 to your computer and use it in GitHub Desktop.
// 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