Notes on “Why Functional Programming Matters”

October 8, 2008

Why Functional Programming Matters: John Hughes

Two functional language features, higher-order functions and lazy evaluation, allow for improved modularity in computer programs. For this reason, functional languages are important.

For example, reduce over lists and trees can be used to create other powerful functions such as sum, product and map. An abstraction for iterative improvement algorithms allows for simple square root calculations, derivatives and integrals. A combination of higher-order functions and lazy evaluation allows for a simple minimax implementation with alpha-beta pruning.

The first few examples given in this paper are drawn from the Structure and Interpretation of Computer Programs. This overlap makes me wonder: Perhaps functional languages are excellent for these specific tasks, or perhaps it is difficult to discover new generally useful functional abstractions.

%d bloggers like this: