U -> Void) -> T -> U -> T { return { a in { b in var c = a transform(&c)(b) return c } } } let first = [1, 2, 3] let second = [4, 5, 6] let third = apply(Array.appendContentsOf)(first)(second)
return pattern(value) } func isEven<T: IntegerType>(a: T) -> Bool { return a % 2 == 0 } let x = 3 switch x { case isEven: print("even") default: print("odd") } @olebegemann's post on pattern matching