[commit: ghc] master: MkIface: Turn a foldr into a foldl' (3991da4)

git at git.haskell.org git at git.haskell.org
Fri Oct 14 02:58:59 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/3991da46102191b0258cbac9c4e00b7771a9b721/ghc

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

commit 3991da46102191b0258cbac9c4e00b7771a9b721
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.


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

3991da46102191b0258cbac9c4e00b7771a9b721
 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 12980e4..1a191db 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -467,8 +467,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 = getOccName d
 



More information about the ghc-commits mailing list