[commit: ghc] wip/names3: MkIface: Turn a foldr into a foldl' (0c07c44)

git at git.haskell.org git at git.haskell.org
Thu Sep 8 18:52:03 UTC 2016


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

On branch  : wip/names3
Link       : http://ghc.haskell.org/trac/ghc/changeset/0c07c44cf5ac228a44585eb8148d2103718003d9/ghc

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

commit 0c07c44cf5ac228a44585eb8148d2103718003d9
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Aug 22 23:18:02 2016 -0400

    MkIface: Turn a foldr into a foldl'
    
    There is no reason why this should be a foldr considering we are
    building a map.


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

0c07c44cf5ac228a44585eb8148d2103718003d9
 compiler/iface/MkIface.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index 4c44e25..ce8bc24 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -411,8 +411,8 @@ addFingerprints hsc_env mb_old_fingerprint iface0 new_decls
         -- e.g. a reference to a constructor must be turned into a reference
         -- to the TyCon for the purposes of calculating dependencies.
        parent_map :: OccEnv OccName
-       parent_map = foldr extend emptyOccEnv new_decls
-          where extend d env =
+       parent_map = foldl' extend emptyOccEnv new_decls
+          where extend env d =
                   extendOccEnvList env [ (b,n) | b <- ifaceDeclImplicitBndrs d ]
                   where n = ifName d
 



More information about the ghc-commits mailing list