5
First-Class Functions
In the previous chapter, we studied higher-order functions (HOFs), one of the defining features of functional programming. This chapter explains how Haskell actively supports working with HOFs by providing a number of facilitating language features.
The ability of HOFs to abstract over functions means that they are more reusable than first-order functions. Indeed, often tasks can be concisely handled by assembling a number of predefined higher-order functions. Of course, HOFs are useless without the functions that we supply to them as parameters. Hence, part of the effectiveness of HOFs stems from being able to quickly and concisely supply the right function parameters to instantiate the HOFs.
In the previous chapter, ...
Get Soar with Haskell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.