Gabriel439/Haskell-Foldl-Library — pull request #3 by gereeter (2013-08-25 22:51:00+00:00)
Title: Add input list transformation functions

This change adds combinators to change the list that is being folded over. For example, a Fold that multiplies the sum of the even numbers and the sum of the odd numbers in a list could be written like this:

weird :: Fold Int Int
weird = (*) <$> filtered even sum <*> filtered odd sum

Showing it off:

> fold weird [1, 2, 3]
8
> fold weird [1, 2]
2

Without these functions, there was no way to easily do this in one traversal.