Function composition

Functions may also be composed. The action of composition itself is a predefined function:


(.) :: (b -> c) -> (a -> b) -> a -> c
(f . g) x = f (g x)

Note that only functions whose types match may be composed:


square :: Integer -> Integer
quad = square . square