• Michal Terepeta's avatar
    Hoopl.Collections: change right folds to strict left folds · 2974b2b8
    Michal Terepeta authored
    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's avatarMichal Terepeta <michal.terepeta@gmail.com>
    Test Plan: ./validate
    Reviewers: bgamari, simonmar
    Reviewed By: bgamari
    Subscribers: rwbarton, thomie, carter, kavon
    Differential Revision: https://phabricator.haskell.org/D4356
CmmProcPoint.hs 20.6 KB