Created
August 24, 2015 05:50
-
-
Save macbaszii/e96c3eb478236758797a to your computer and use it in GitHub Desktop.
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
| typealias IntFunction = Int -> Int | |
| func map(f: IntFunction, _ g: IntFunction) -> IntFunction { | |
| return { x in f(g(x)) } | |
| } | |
| let foo = map({ $0 + 2 }, { $0 + 3 }) | |
| foo(10) | |
| // => 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment