[commit: ghc] wip/names3: MkIface: Turn a foldr into a foldl' (6a58e04)
git at git.haskell.org
git at git.haskell.org
Thu Oct 13 22:34:40 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/names3
Link : http://ghc.haskell.org/trac/ghc/changeset/6a58e0452fe79ca67ce3385c862b9b70f33f2d0a/ghc
>---------------------------------------------------------------
commit 6a58e0452fe79ca67ce3385c862b9b70f33f2d0a
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.
>---------------------------------------------------------------
6a58e0452fe79ca67ce3385c862b9b70f33f2d0a
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