Hoopl.Collections: change right folds to strict left folds

Authored by michalt on Jan 30 2018, 1:05 PM.



It seems that most uses of these folds should be strict left folds
(I could only find a single place that benefits from a right fold).
So this removes the existing setFold/mapFold/mapFoldWihKey
replaces them with:

  • setFoldl/mapFoldl/mapFoldlWithKey (strict left folds)
  • setFoldr/mapFoldr (for the less common case where a right fold actually makes sense, e.g., CmmProcPoint)

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
michalt created this revision.Jan 30 2018, 1:05 PM
bgamari accepted this revision.Jan 31 2018, 10:43 PM

Looks good to me.

This revision is now accepted and ready to land.Jan 31 2018, 10:43 PM
This revision was automatically updated to reflect the committed changes.