Example of a functional programming refactoring pattern
Often, discussions and tutorials about refactoring focus on object-oriented languages. It's not clear if this stems from the fact that Martin Fowler's absolute masterpiece, Refactoring: Improving the Design of Existing Code, targets OO, or if it's simply that OO is still the dominant paradigm in the code out there needing refactoring, or some other reason.