Gifu/Source/Curry.swift

5 lines
128 B
Swift

/// One of my favorite indian spices.
func curry<A, B, C>(f: (A, B) -> C) -> A -> B -> C {
return { a in { b in f(a, b) } }
}