Created
June 4, 2014 01:30
-
-
Save ayanonagon/47916cff9b1e86f1c19c to your computer and use it in GitHub Desktop.
Revisions
-
ayanonagon created this gist
Jun 4, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ func fp<A, B, C>(fn:((A, B) -> C), arg:A) -> (B -> C) { func apply(b:B) -> C { return fn(arg, b) } return apply } func add(x: Int, y: Int) -> Int { return x + y } let addThree = fp(add, 3) addThree(0) addThree(1) addThree(2) addThree(3)