Function composition. This function usually isn't necessary, but it
can be more readable than some alternatives when used with
higher-order functions like
map.
>>> let fs = map (compose succ) [recip, negate]
>>> map (apply 3) fs
[0.25,-4.0]
In general you should prefer using an explicit lambda or operator
section.
>>> map (\ f -> f 3) (map (\ f -> succ .> f) [recip, negate])
[0.25,-4.0]
>>> map (\ f -> f 3) (map (succ .>) [recip, negate])
[0.25,-4.0]
>>> map (\ f -> f 3) (map (<. succ) [recip, negate])
[0.25,-4.0]
\ x -> compose f g x == g (f x)