Last active
April 21, 2016 14:57
-
-
Save comfly/3934902c878483a2f48f57f43cc3bb5b 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
import Foundation | |
infix operator <| { associativity right precedence 95 } | |
func <|<A, R>(@noescape f: A -> R, a: A) -> R { | |
return f(a) | |
} | |
func <|<A, B, R>(@noescape f: (A, B) -> R, a: (A, B)) -> R { | |
return f(a.0, a.1) | |
} | |
let a = (10, "String") | |
func f(a: (Int, String)) -> String { | |
return "TUPLE" | |
} | |
func f(a: Int, _ b: String) -> String { | |
return "2ARY" | |
} | |
let k = f(_:_:) <| a | |
print(k) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment