Effective Haskell (Chapter 2 - pp. 51 and 54 in ePub)

In the “Filtering List Elements” section, the party budget function is first called “foodBudget” and all subsequent reference are “partyBudget”.

I filled in the implementation of the list comprehension version of partyBudget and was surprised at the result when two people in the guest list had the same food, but willEat for one person was false: the result was twice the food. Duh, of course that’s because of the non-determinism of list comprehensions (the permutations from peeling off the fst and snd elements of the tuples). The Roman Numeral example touches on this, but I wonder if there could be a bit more explicit discussion of what’s going on when there are multiple lists as generators in list comprehensions.

Thanks for bringing this to my attention, I’ll see if I can make that a bit more clear!