[Git][ghc/ghc][wip/T23923-mikolaj-take-2] Explain better how shallowCoVarsOfCosDSet is entangled with a hundreds of...

Mikolaj Konarski (@Mikolaj) gitlab at gitlab.haskell.org
Thu Feb 8 13:16:14 UTC 2024



Mikolaj Konarski pushed to branch wip/T23923-mikolaj-take-2 at Glasgow Haskell Compiler / GHC


Commits:
a4913651 by Mikolaj Konarski at 2024-02-08T14:15:01+01:00
Explain better how shallowCoVarsOfCosDSet is entangled with a hundreds of lines bit-rotten refactoring

- - - - -


1 changed file:

- compiler/GHC/Core/TyCo/FVs.hs


Changes:

=====================================
compiler/GHC/Core/TyCo/FVs.hs
=====================================
@@ -452,7 +452,12 @@ deepCoVarFolder = TyCoFolder { tcf_view = noView
 
 shallowCoVarsOfCosDSet :: [Coercion] -> DCoVarSet
 shallowCoVarsOfCosDSet _cos = undefined  -- !!!   runTCA (shallow_dcv_cos cos) emptyVarSet emptyDVarSet
-{- TODO: !!! lots of other code and refactorings, partially bit-rotten, would need to be taken from !3792
+{- TODO: !!! lots of other code and refactorings, partially bit-rotten, would need to be taken from !3792 --- in particular
+
+* should I port the removal of the `env` parameter from `TyCoFolder`, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3792/diffs#578c7c3857d66d963736ff6742f3433a0e8d01b7_1883_2076? That's 200 lines in the old GHC.Core.TyCo.Rep alone and who know how many lines in the new versions of these files. If not, what `env` to use in `shallowCoVarDSetFolder`, a couple of lines below in the place marked as {-!!!-}? Is this relatively shallow (e.g., if the env type-checks, it's likely to be correct?)?
+
+* should I introduce TyCoAcc, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3792/diffs#039e8f5676356ef05c90af828aae48aac7296e47_266_268 and then also use it for many other operations (e.g., instead of Endo)?
+
 
 shallow_dcv_cos  :: [Coercion] -> TyCoAcc DCoVarSet
 (_, _, _, shallow_dcv_cos) = foldTyCo shallowCoVarDSetFolder



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a4913651af78b7929eadb71038043994ce9d8e89
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/20240208/b29be372/attachment.html>


More information about the ghc-commits mailing list