[Git][ghc/ghc][wip/sjakobi/nondetfolds] Try a strict fold for closeOverKinds

Simon Jakobi gitlab at gitlab.haskell.org
Thu Apr 2 01:03:46 UTC 2020



Simon Jakobi pushed to branch wip/sjakobi/nondetfolds at Glasgow Haskell Compiler / GHC


Commits:
e3daee46 by Simon Jakobi at 2020-04-02T03:03:26+02:00
Try a strict fold for closeOverKinds

- - - - -


2 changed files:

- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Types/Var/Set.hs


Changes:

=====================================
compiler/GHC/Core/TyCo/FVs.hs
=====================================
@@ -441,7 +441,7 @@ deepCoVarFolder = TyCoFolder { tcf_view = noView
 closeOverKinds :: TyCoVarSet -> TyCoVarSet
 -- For each element of the input set,
 -- add the deep free variables of its kind
-closeOverKinds vs = nonDetFoldVarSet do_one vs vs -- TODO?
+closeOverKinds vs = nonDetStrictFoldVarSet do_one vs vs
   where
     do_one v acc = appEndo (deep_ty (varType v)) acc
 


=====================================
compiler/GHC/Types/Var/Set.hs
=====================================
@@ -23,7 +23,7 @@ module GHC.Types.Var.Set (
         sizeVarSet, seqVarSet,
         elemVarSetByKey, partitionVarSet,
         pluralVarSet, pprVarSet,
-        nonDetFoldVarSet,
+        nonDetFoldVarSet, nonDetStrictFoldVarSet,
 
         -- * Deterministic Var set types
         DVarSet, DIdSet, DTyVarSet, DTyCoVarSet,
@@ -157,6 +157,9 @@ mapVarSet = mapUniqSet
 nonDetFoldVarSet :: (Var -> a -> a) -> a -> VarSet -> a
 nonDetFoldVarSet = nonDetFoldUniqSet
 
+nonDetStrictFoldVarSet :: (Var -> a -> a) -> a -> VarSet -> a
+nonDetStrictFoldVarSet = nonDetStrictFoldUniqSet
+
 fixVarSet :: (VarSet -> VarSet)   -- Map the current set to a new set
           -> VarSet -> VarSet
 -- (fixVarSet f s) repeatedly applies f to the set s,



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3daee4652c146ca92eefea9493815bac1ce8895

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3daee4652c146ca92eefea9493815bac1ce8895
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/20200401/70a1261b/attachment-0001.html>


More information about the ghc-commits mailing list