Higher Order Functions and Folds (CIS194 Wk 4) by Christopher McKay
Higher Order Functions and Folds (CIS194 Wk 4)
By Christopher McKay
So far we have explored data types, pattern matching, and recursive functions in our quest to achieve functional enlightenment, but singular functions alone are lonely things. If only we could assemble a number of functions together to form a super function...
This month we explore methods to compose functions together, through currying and partial application, treating them as Higher-Order functions, and eventually exploring folds. Through this we can reduce the complexity and amount of code we write in common patterns by combining pre-made implementations with application-specific code.