Lecture 17 - Higher Order Functions
Lecture 17 - Higher Order Functions
(f.g) x = f (g x)
• OR
• The result of f.g has the same input type as g (a) and the same output type of
f (b)
Note also, Composition is associative
• f.(g.h) is equal to (f.g).h for all f, g, h
• f.g.h means “apply h, then g, then f
Remember
• If you prefer, you can define your own operator that evaluates from left to right
but we will stay with the above in order to maintain consistency with the
underlying mathematical notation