Created
June 8, 2015 04:08
-
-
Save Ben-G/ed1586704f4cbacbaa56 to your computer and use it in GitHub Desktop.
"Optional chaining for functions" using map and curried functions
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
var a: String? = "a" | |
var b: String? = "b" | |
func twoParamFunction(a: String)(b:String) { | |
println("\(a)\(b)") | |
} | |
a.map(twoParamFunction).map { b.map($0)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
?twoParamFunction(nil, nil)