[Git][ghc/ghc][wip/T23923-mikolaj-take-2] Make sure the foldl' accumulators are strict
Mikolaj Konarski (@Mikolaj)
gitlab at gitlab.haskell.org
Tue Mar 5 22:50:47 UTC 2024
Mikolaj Konarski pushed to branch wip/T23923-mikolaj-take-2 at Glasgow Haskell Compiler / GHC
Commits:
f6f06963 by Mikolaj Konarski at 2024-03-05T23:50:20+01:00
Make sure the foldl' accumulators are strict
- - - - -
2 changed files:
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Types/Unique/DSet.hs
Changes:
=====================================
compiler/GHC/Core/TyCo/Rep.hs
=====================================
@@ -1905,7 +1905,7 @@ foldTyCo (TyCoFolder { tcf_view = view
go_prov env (ProofIrrelProv co) = go_co env co
go_prov _ (PluginProv _ cvs) = go_cvs env cvs
- go_cvs env cvs = foldl' (\acc cv -> acc `mappend` covar env cv) mempty (dVarSetElems cvs)
+ go_cvs env cvs = foldl' (\ !acc cv -> acc `mappend` covar env cv) mempty (dVarSetElems cvs)
-- | A view function that looks through nothing.
noView :: Type -> Maybe Type
=====================================
compiler/GHC/Types/Unique/DSet.hs
=====================================
@@ -132,7 +132,7 @@ mapUniqDSet f (UniqDSet m) = UniqDSet $ unsafeCastUDFMKey $ mapUDFM f m
-- mapping from DFM.
strictFoldUniqDSet :: (a -> r -> r) -> r -> UniqDSet a -> r
-strictFoldUniqDSet k r s = foldl' (\r e -> k e r) r $
+strictFoldUniqDSet k r s = foldl' (\ !r e -> k e r) r $
uniqDSetToList s
-- Two 'UniqDSet's are considered equal if they contain the same
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f6f06963c8e6dc0b027323dfcfb3cc5637ee5d3b
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f6f06963c8e6dc0b027323dfcfb3cc5637ee5d3b
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240305/fbb70109/attachment-0001.html>
More information about the ghc-commits
mailing list