Functions on functions
The functions in this module are rather useless on their own but they’re commonly used when programming in a functional style with higher-order functions.
The composition of two functions
g is a function that applies
g and then
compose(f, g)(x) = f(g(x))
func compose<A, B, C>(f : (B) -> C, g : (A) -> B) : (A) -> C
identity function returns its argument.
identity(10) = 10 identity(true) = true
func identity<A>(x : A) : A