b = sum((j if j % 2 else 0) for (j, k) in results if k)
This definitely is borderline unreadable but that isn't necessarily because it does a lot of things. It is because it does a lot of things without order and with a lot of line noise. Compare it with
sum [j | (j, True) <- results, odd j]
or
filter snd >>> map fst >>> filter odd >>> sum
The bigger problem is that this carries a bool around. If it is only used for filtering filter it beforehand.
The Opportunity for correction is an interesting idea but the authors issue mostly come from a lack of referential transparency. In a pure language refactoring wouldn't be an issue so one could argue this is a symptom of too little abstraction, not too much.
The Opportunity for correction is an interesting idea but the authors issue mostly come from a lack of referential transparency. In a pure language refactoring wouldn't be an issue so one could argue this is a symptom of too little abstraction, not too much.