As another nice effect, higher-order functions (or as we call them in their use as control structures: combinators) unify data structure and control structures. E.g. folding over a list is equivalent to various loops, the Monad instance of Maybe represents simple exception handling, trees and their traversal are identifiable in some sense, etc.
At least in lazy, statically typed functional languages, like e.g. Haskell.
Re:Functional Programming in 5 Minutes
by Paradigma11 on Monday May 20, 2013 @06:56AM
(#5736917)
I agree but using mutual recursion to model simple state machines is very nice.
Having a good library of higher-order functions that encapsulate common recursion patterns is a lot nicer than doing recursion by hand, or having to read code where someone did recursion by hand and you have to not only figure out how the recursion works, but whether the author did anything wrong.
Higher-order functions are control structures, and we should encourage their use for all the same reasons we encourage the use of while loops in preference to people building their loop structures by hand out of gotos and conditional gotos.