15-150: Principles of Functional Programming

Lecture 10: Higher-Order Functions

We defined what it means to curry a function and how to write curried functions in SML.

We reviewed closures (code and environment) and how bindings of function values to identifiers occur.
If you have forgotten, please revisit Lecture 2.

We discussed higher order functions, specifically, passing functions as arguments, returning functions as values, and mapping functions over recursive data structures. Key to understanding functions as first class values is understanding the lexical scoping rules.

We discussed several important higher-order functions, such as composition (given by SML's infix operator o) and the list functions map, foldl, and foldr.

Key Concepts

Sample Code

Some Notes on Higher-Order Functions