[commit: ghc] master: Hoopl.Collections: change right folds to strict left folds (2974b2b)

git at git.haskell.org git at git.haskell.org
Sat Feb 3 00:56:29 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2974b2b873b4bad007c619c6e32706123a612428/ghc

>---------------------------------------------------------------

commit 2974b2b873b4bad007c619c6e32706123a612428
Author: Michal Terepeta <michal.terepeta at gmail.com>
Date:   Thu Feb 1 00:30:22 2018 -0500

    Hoopl.Collections: change right folds to strict left folds
    
    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 at gmail.com>
    
    Test Plan: ./validate
    
    Reviewers: bgamari, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter, kavon
    
    Differential Revision: https://phabricator.haskell.org/D4356


>---------------------------------------------------------------

2974b2b873b4bad007c619c6e32706123a612428
 compiler/cmm/CmmCommonBlockElim.hs         |  4 ++--
 compiler/cmm/CmmContFlowOpt.hs             |  6 +++---
 compiler/cmm/CmmProcPoint.hs               | 20 ++++++++++----------
 compiler/cmm/CmmUtils.hs                   |  6 +++---
 compiler/cmm/Hoopl/Collections.hs          | 16 ++++++++++------
 compiler/cmm/Hoopl/Dataflow.hs             |  8 ++++----
 compiler/cmm/Hoopl/Graph.hs                |  6 +++---
 compiler/cmm/Hoopl/Label.hs                |  9 ++++++---
 compiler/nativeGen/RegAlloc/Graph/Spill.hs |  9 ++++-----
 9 files changed, 45 insertions(+), 39 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2974b2b873b4bad007c619c6e32706123a612428


More information about the ghc-commits mailing list