Skip to content
Snippets Groups Projects
Commit 2304c697 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

compiler: Make OccSet opaque

parent 4af7eac2
No related branches found
No related tags found
No related merge requests found
......@@ -809,7 +809,7 @@ forceOccEnv nf (MkOccEnv fs) = seqEltsUFM (seqEltsUFM nf) fs
--------------------------------------------------------------------------------
type OccSet = FastStringEnv (UniqSet NameSpace)
newtype OccSet = OccSet (FastStringEnv (UniqSet NameSpace))
emptyOccSet :: OccSet
unitOccSet :: OccName -> OccSet
......@@ -821,15 +821,15 @@ unionManyOccSets :: [OccSet] -> OccSet
elemOccSet :: OccName -> OccSet -> Bool
isEmptyOccSet :: OccSet -> Bool
emptyOccSet = emptyFsEnv
unitOccSet (OccName ns s) = unitFsEnv s (unitUniqSet ns)
emptyOccSet = OccSet emptyFsEnv
unitOccSet (OccName ns s) = OccSet $ unitFsEnv s (unitUniqSet ns)
mkOccSet = extendOccSetList emptyOccSet
extendOccSet occs (OccName ns s) = extendFsEnv occs s (unitUniqSet ns)
extendOccSetList = foldl extendOccSet
unionOccSets = plusFsEnv_C unionUniqSets
extendOccSet (OccSet occs) (OccName ns s) = OccSet $ extendFsEnv occs s (unitUniqSet ns)
extendOccSetList = foldl' extendOccSet
unionOccSets (OccSet xs) (OccSet ys) = OccSet $ plusFsEnv_C unionUniqSets xs ys
unionManyOccSets = foldl' unionOccSets emptyOccSet
elemOccSet (OccName ns s) occs = maybe False (elementOfUniqSet ns) $ lookupFsEnv occs s
isEmptyOccSet = isNullUFM
elemOccSet (OccName ns s) (OccSet occs) = maybe False (elementOfUniqSet ns) $ lookupFsEnv occs s
isEmptyOccSet (OccSet occs) = isNullUFM occs
{-
************************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment