[Git][ghc/ghc][wip/romes/more-debugger] Export sizeOccEnv from GHC.Types.Name.Occurrence

Rodrigo Mesquita pushed to branch wip/romes/more-debugger at Glasgow Haskell Compiler / GHC Commits: fd7f3f11 by Rodrigo Mesquita at 2025-04-17T17:57:43+01:00 Export sizeOccEnv from GHC.Types.Name.Occurrence Counts the number of OccNames in an OccEnv - - - - - 1 changed file: - compiler/GHC/Types/Name/Occurrence.hs Changes: ===================================== compiler/GHC/Types/Name/Occurrence.hs ===================================== @@ -92,6 +92,7 @@ module GHC.Types.Name.Occurrence ( plusOccEnv, plusOccEnv_C, extendOccEnv_Acc, filterOccEnv, delListFromOccEnv, delFromOccEnv, alterOccEnv, minusOccEnv, minusOccEnv_C, minusOccEnv_C_Ns, + sizeOccEnv, pprOccEnv, forceOccEnv, intersectOccEnv_C, @@ -803,6 +804,10 @@ minusOccEnv_C_Ns f (MkOccEnv as) (MkOccEnv bs) = then Nothing else Just m +sizeOccEnv :: OccEnv a -> Int +sizeOccEnv (MkOccEnv as) = + nonDetFoldFsEnv (\ m !acc -> acc + sizeUFM m) 0 as + instance Outputable a => Outputable (OccEnv a) where ppr x = pprOccEnv ppr x View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd7f3f11aa945f910a5f41ef50ea2775... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd7f3f11aa945f910a5f41ef50ea2775... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)