ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Types.Name.Occurrence

Contents

- The `NameSpace` type
  - Construction
  - Pretty Printing
- The `OccName` type
  - Construction
  - Derived `OccName`s
  - Deconstruction
- The `OccEnv` type
- The `OccSet` type
- Tidying up

Description

GHC uses several kinds of name internally:

- `OccName` represents names as strings with just a little more information: the "namespace" that the name came from, e.g. the namespace of value, type constructors or data constructors
- `RdrName`: see GHC.Types.Name.Reader
- `Name`: see GHC.Types.Name
- `Id`: see GHC.Types.Id
- `Var`: see GHC.Types.Var

Synopsis

- data NameSpace
- tcName :: NameSpace
- clsName :: NameSpace
- tcClsName :: NameSpace
- dataName :: NameSpace
- varName :: NameSpace
- tvName :: NameSpace
- srcDataName :: NameSpace
- pprNameSpace :: NameSpace -> SDoc
- pprNonVarNameSpace :: NameSpace -> SDoc
- pprNameSpaceBrief :: IsLine doc => NameSpace -> doc
- data OccName
- pprOccName :: IsLine doc => OccName -> doc
- mkOccName :: NameSpace -> String -> OccName
- mkOccNameFS :: NameSpace -> FastString -> OccName
- mkVarOcc :: String -> OccName
- mkVarOccFS :: FastString -> OccName
- mkDataOcc :: String -> OccName
- mkDataOccFS :: FastString -> OccName
- mkTyVarOcc :: String -> OccName
- mkTyVarOccFS :: FastString -> OccName
- mkTcOcc :: String -> OccName
- mkTcOccFS :: FastString -> OccName
- mkClsOcc :: String -> OccName
- mkClsOccFS :: FastString -> OccName
- mkDFunOcc :: String -> Bool -> OccSet -> OccName
- setOccNameSpace :: NameSpace -> OccName -> OccName
- demoteOccName :: OccName -> Maybe OccName
- promoteOccName :: OccName -> Maybe OccName
- class HasOccName name where
  - occName :: name -> OccName
- isDerivedOccName :: OccName -> Bool
- mkDataConWrapperOcc :: OccName -> OccName
- mkWorkerOcc :: OccName -> OccName
- mkMatcherOcc :: OccName -> OccName
- mkBuilderOcc :: OccName -> OccName
- mkDefaultMethodOcc :: OccName -> OccName
- isDefaultMethodOcc :: OccName -> Bool
- isTypeableBindOcc :: OccName -> Bool
- mkNewTyCoOcc :: OccName -> OccName
- mkClassOpAuxOcc :: OccName -> OccName
- mkCon2TagOcc :: OccName -> OccName
- mkTag2ConOcc :: OccName -> OccName
- mkMaxTagOcc :: OccName -> OccName
- mkClassDataConOcc :: OccName -> OccName
- mkDictOcc :: OccName -> OccName
- mkIPOcc :: OccName -> OccName
- mkSpecOcc :: OccName -> OccName
- mkForeignExportOcc :: OccName -> OccName
- mkRepEqOcc :: OccName -> OccName
- mkGenR :: OccName -> OccName
- mkGen1R :: OccName -> OccName
- mkDataTOcc :: OccName -> OccName
- mkDataCOcc :: OccName -> OccName
- mkDataConWorkerOcc :: OccName -> OccName
- mkSuperDictSelOcc :: Int -> OccName -> OccName
- mkSuperDictAuxOcc :: Int -> OccName -> OccName
- mkLocalOcc :: Unique -> OccName -> OccName
- mkMethodOcc :: OccName -> OccName
- mkInstTyTcOcc :: String -> OccSet -> OccName
- mkInstTyCoOcc :: OccName -> OccName
- mkEqPredCoOcc :: OccName -> OccName
- mkRecFldSelOcc :: FastString -> OccName
- mkTyConRepOcc :: OccName -> OccName
- occNameFS :: OccName -> FastString
- occNameString :: OccName -> String
- occNameSpace :: OccName -> NameSpace
- isVarOcc :: OccName -> Bool
- isTvOcc :: OccName -> Bool
- isTcOcc :: OccName -> Bool
- isDataOcc :: OccName -> Bool
- isDataSymOcc :: OccName -> Bool
- isSymOcc :: OccName -> Bool
- isValOcc :: OccName -> Bool
- parenSymOcc :: OccName -> SDoc -> SDoc
- startsWithUnderscore :: OccName -> Bool
- isTcClsNameSpace :: NameSpace -> Bool
- isTvNameSpace :: NameSpace -> Bool
- isDataConNameSpace :: NameSpace -> Bool
- isVarNameSpace :: NameSpace -> Bool
- isValNameSpace :: NameSpace -> Bool
- data OccEnv a
- emptyOccEnv :: OccEnv a
- unitOccEnv :: OccName -> a -> OccEnv a
- extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a
- mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b
- lookupOccEnv :: OccEnv a -> OccName -> Maybe a
- mkOccEnv :: [(OccName, a)] -> OccEnv a
- mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a
- extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a
- elemOccEnv :: OccName -> OccEnv a -> Bool
- nonDetOccEnvElts :: OccEnv a -> [a]
- foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
- plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
- plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a
- extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a
- extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b
- filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt
- delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a
- delFromOccEnv :: OccEnv a -> OccName -> OccEnv a
- alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt
- minusOccEnv :: OccEnv a -> OccEnv b -> OccEnv a
- minusOccEnv_C :: (a -> b -> Maybe a) -> OccEnv a -> OccEnv b -> OccEnv a
- pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc
- type OccSet = UniqSet OccName
- emptyOccSet :: OccSet
- unitOccSet :: OccName -> OccSet
- mkOccSet :: [OccName] -> OccSet
- extendOccSet :: OccSet -> OccName -> OccSet
- extendOccSetList :: OccSet -> [OccName] -> OccSet
- unionOccSets :: OccSet -> OccSet -> OccSet
- unionManyOccSets :: [OccSet] -> OccSet
- minusOccSet :: OccSet -> OccSet -> OccSet
- elemOccSet :: OccName -> OccSet -> Bool
- isEmptyOccSet :: OccSet -> Bool
- intersectOccSet :: OccSet -> OccSet -> OccSet
- filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
- occSetToEnv :: OccSet -> OccEnv OccName
- type TidyOccEnv = UniqFM FastString Int
- emptyTidyOccEnv :: TidyOccEnv
- initTidyOccEnv :: [OccName] -> TidyOccEnv
- tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
- avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
- delTidyOccEnvList :: TidyOccEnv -> [FastString] -> TidyOccEnv
- type FastStringEnv a = UniqFM FastString a
- emptyFsEnv :: FastStringEnv a
- lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
- extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
- mkFsEnv :: [(FastString, a)] -> FastStringEnv a

# The `NameSpace` type

data NameSpace Source #

#### Instances

Instances details

Binary NameSpace Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods put_ :: BinHandle -> NameSpace -> IO () Source # put :: BinHandle -> NameSpace -> IO (Bin NameSpace) Source # get :: BinHandle -> IO NameSpace Source #
Eq NameSpace Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods (==) :: NameSpace -> NameSpace -> Bool # (/=) :: NameSpace -> NameSpace -> Bool #
Ord NameSpace Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods compare :: NameSpace -> NameSpace -> Ordering # (<) :: NameSpace -> NameSpace -> Bool # (<=) :: NameSpace -> NameSpace -> Bool # (>) :: NameSpace -> NameSpace -> Bool # (>=) :: NameSpace -> NameSpace -> Bool # max :: NameSpace -> NameSpace -> NameSpace # min :: NameSpace -> NameSpace -> NameSpace #

## Construction

There are two forms of data constructor:

Source data constructors
  The data constructors mentioned in Haskell source code
Real data constructors
  The data constructors of the representation type, which may not be the same as the source type

For example:

    data T = T !(Int, Int)

The source datacon has type `(Int, Int) -> T` The real datacon has type `Int -> Int -> T`

GHC chooses a representation based on the strictness etc.

tcName :: NameSpace Source #

clsName :: NameSpace Source #

tcClsName :: NameSpace Source #

dataName :: NameSpace Source #

varName :: NameSpace Source #

tvName :: NameSpace Source #

srcDataName :: NameSpace Source #

## Pretty Printing

pprNameSpace :: NameSpace -> SDoc Source #

pprNonVarNameSpace :: NameSpace -> SDoc Source #

pprNameSpaceBrief :: IsLine doc => NameSpace -> doc Source #

# The `OccName` type

data OccName Source #

Occurrence Name

In this context that means: "classified (i.e. as a type name, value name, etc) but not qualified and not yet resolved"

#### Instances

Instances details

Data OccName Source # |

Instance details

Defined in GHC.Types.Name.Occurrence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName Source #

toConstr :: OccName -> Constr Source #

dataTypeOf :: OccName -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) Source #

gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source #

NFData OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods rnf :: OccName -> () Source #
HasOccName OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods occName :: OccName -> OccName Source #
Uniquable OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods getUnique :: OccName -> Unique Source #
Binary OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods put_ :: BinHandle -> OccName -> IO () Source # put :: BinHandle -> OccName -> IO (Bin OccName) Source # get :: BinHandle -> IO OccName Source #
Outputable OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods ppr :: OccName -> SDoc Source #
OutputableBndr OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods pprBndr :: BindingSite -> OccName -> SDoc Source # pprPrefixOcc :: OccName -> SDoc Source # pprInfixOcc :: OccName -> SDoc Source # bndrIsJoin_maybe :: OccName -> Maybe Int Source #
Eq OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods (==) :: OccName -> OccName -> Bool # (/=) :: OccName -> OccName -> Bool #
Ord OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods compare :: OccName -> OccName -> Ordering # (<) :: OccName -> OccName -> Bool # (<=) :: OccName -> OccName -> Bool # (>) :: OccName -> OccName -> Bool # (>=) :: OccName -> OccName -> Bool # max :: OccName -> OccName -> OccName # min :: OccName -> OccName -> OccName #

pprOccName :: IsLine doc => OccName -> doc Source #

## Construction

mkOccName :: NameSpace -> String -> OccName Source #

mkOccNameFS :: NameSpace -> FastString -> OccName Source #

mkVarOcc :: String -> OccName Source #

mkVarOccFS :: FastString -> OccName Source #

mkDataOcc :: String -> OccName Source #

mkDataOccFS :: FastString -> OccName Source #

mkTyVarOcc :: String -> OccName Source #

mkTyVarOccFS :: FastString -> OccName Source #

mkTcOcc :: String -> OccName Source #

mkTcOccFS :: FastString -> OccName Source #

mkClsOcc :: String -> OccName Source #

mkClsOccFS :: FastString -> OccName Source #

mkDFunOcc Source #

Arguments

:: String | Typically the class and type glommed together e.g. `OrdMaybe`. Only used in debug mode, for extra clarity
-> Bool | Is this a hs-boot instance DFun?
-> OccSet | avoid these Occs
-> OccName | E.g. `$f3OrdMaybe`

setOccNameSpace :: NameSpace -> OccName -> OccName Source #

demoteOccName :: OccName -> Maybe OccName Source #

promoteOccName :: OccName -> Maybe OccName Source #

class HasOccName name where Source #

Other names in the compiler add additional information to an OccName. This class provides a consistent way to access the underlying OccName.

Methods

occName :: name -> OccName Source #

#### Instances

Instances details

HasOccName IfaceClassOp Source # |
Instance details Defined in GHC.Iface.Syntax Methods occName :: IfaceClassOp -> OccName Source #
HasOccName IfaceConDecl Source # |
Instance details Defined in GHC.Iface.Syntax Methods occName :: IfaceConDecl -> OccName Source #
HasOccName IfaceDecl Source # |
Instance details Defined in GHC.Iface.Syntax Methods occName :: IfaceDecl -> OccName Source #
HasOccName HoleFitCandidate Source # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods occName :: HoleFitCandidate -> OccName Source #
HasOccName TcBinder Source # |
Instance details Defined in GHC.Tc.Types Methods occName :: TcBinder -> OccName Source #
HasOccName GreName Source # |
Instance details Defined in GHC.Types.Avail Methods occName :: GreName -> OccName Source #
HasOccName FieldLabel Source # |
Instance details Defined in GHC.Types.FieldLabel Methods occName :: FieldLabel -> OccName Source #
HasOccName Name Source # |
Instance details Defined in GHC.Types.Name Methods occName :: Name -> OccName Source #
HasOccName OccName Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods occName :: OccName -> OccName Source #
HasOccName GlobalRdrElt Source # |
Instance details Defined in GHC.Types.Name.Reader Methods occName :: GlobalRdrElt -> OccName Source #
HasOccName RdrName Source # |
Instance details Defined in GHC.Types.Name.Reader Methods occName :: RdrName -> OccName Source #
HasOccName Var Source # |
Instance details Defined in GHC.Types.Var Methods occName :: Var -> OccName Source #
(HasOccName (IdP (GhcPass p)), OutputableBndrId p) => HasOccName (IEWrappedName (GhcPass p)) Source # |
Instance details Defined in GHC.Hs.ImpExp Methods occName :: IEWrappedName (GhcPass p) -> OccName Source #

## Derived `OccName`s

isDerivedOccName :: OccName -> Bool Source #

Test for definitions internally generated by GHC. This predicate is used to suppress printing of internal definitions in some debug prints

mkDataConWrapperOcc :: OccName -> OccName Source #

mkWorkerOcc :: OccName -> OccName Source #

mkMatcherOcc :: OccName -> OccName Source #

mkBuilderOcc :: OccName -> OccName Source #

mkDefaultMethodOcc :: OccName -> OccName Source #

isDefaultMethodOcc :: OccName -> Bool Source #

isTypeableBindOcc :: OccName -> Bool Source #

Is an `OccName` one of a Typeable `TyCon` or `Module` binding? This is needed as these bindings are renamed differently. See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable.

mkNewTyCoOcc :: OccName -> OccName Source #

mkClassOpAuxOcc :: OccName -> OccName Source #

mkCon2TagOcc :: OccName -> OccName Source #

mkTag2ConOcc :: OccName -> OccName Source #

mkMaxTagOcc :: OccName -> OccName Source #

mkClassDataConOcc :: OccName -> OccName Source #

mkDictOcc :: OccName -> OccName Source #

mkIPOcc :: OccName -> OccName Source #

mkSpecOcc :: OccName -> OccName Source #

mkForeignExportOcc :: OccName -> OccName Source #

mkRepEqOcc :: OccName -> OccName Source #

mkGenR :: OccName -> OccName Source #

mkGen1R :: OccName -> OccName Source #

mkDataTOcc :: OccName -> OccName Source #

mkDataCOcc :: OccName -> OccName Source #

mkDataConWorkerOcc :: OccName -> OccName Source #

mkSuperDictSelOcc Source #

Arguments

:: Int | Index of superclass, e.g. 3
-> OccName | Class, e.g. `Ord`
-> OccName | Derived `Occname`, e.g. `$p3Ord`

mkSuperDictAuxOcc :: Int -> OccName -> OccName Source #

mkLocalOcc Source #

Arguments

:: Unique | Unique to combine with the `OccName`
-> OccName | Local name, e.g. `sat`
-> OccName | Nice unique version, e.g. `$L23sat`

mkMethodOcc :: OccName -> OccName Source #

mkInstTyTcOcc Source #

Arguments

:: String | Family name, e.g. `Map`
-> OccSet | avoid these Occs

-> OccName

    R:Map

Derive a name for the representation type constructor of a `data`/`newtype` instance.

mkInstTyCoOcc :: OccName -> OccName Source #

mkEqPredCoOcc :: OccName -> OccName Source #

mkRecFldSelOcc :: FastString -> OccName Source #

mkTyConRepOcc :: OccName -> OccName Source #

## Deconstruction

occNameFS :: OccName -> FastString Source #

occNameString :: OccName -> String Source #

occNameSpace :: OccName -> NameSpace Source #

isVarOcc :: OccName -> Bool Source #

isTvOcc :: OccName -> Bool Source #

isTcOcc :: OccName -> Bool Source #

isDataOcc :: OccName -> Bool Source #

isDataSymOcc :: OccName -> Bool Source #

Test if the `OccName` is a data constructor that starts with a symbol (e.g. `:`, or `[]`)

isSymOcc :: OccName -> Bool Source #

Test if the `OccName` is that for any operator (whether it is a data constructor or variable or whatever)

isValOcc :: OccName -> Bool Source #

Value `OccNames`s are those that are either in the variable or data constructor namespaces

parenSymOcc :: OccName -> SDoc -> SDoc Source #

Wrap parens around an operator

startsWithUnderscore :: OccName -> Bool Source #

Haskell 98 encourages compilers to suppress warnings about unused names in a pattern if they start with `_`: this implements that test

isTcClsNameSpace :: NameSpace -> Bool Source #

isTvNameSpace :: NameSpace -> Bool Source #

isDataConNameSpace :: NameSpace -> Bool Source #

isVarNameSpace :: NameSpace -> Bool Source #

isValNameSpace :: NameSpace -> Bool Source #

# The `OccEnv` type

data OccEnv a Source #

#### Instances

Instances details

Data a => Data (OccEnv a) Source # |

Instance details

Defined in GHC.Types.Name.Occurrence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccEnv a -> c (OccEnv a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OccEnv a) Source #

toConstr :: OccEnv a -> Constr Source #

dataTypeOf :: OccEnv a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OccEnv a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OccEnv a)) Source #

gmapT :: (forall b. Data b => b -> b) -> OccEnv a -> OccEnv a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> OccEnv a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OccEnv a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source #

Outputable a => Outputable (OccEnv a) Source # |
Instance details Defined in GHC.Types.Name.Occurrence Methods ppr :: OccEnv a -> SDoc Source #

emptyOccEnv :: OccEnv a Source #

unitOccEnv :: OccName -> a -> OccEnv a Source #

extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a Source #

mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b Source #

lookupOccEnv :: OccEnv a -> OccName -> Maybe a Source #

mkOccEnv :: [(OccName, a)] -> OccEnv a Source #

mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a Source #

extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a Source #

elemOccEnv :: OccName -> OccEnv a -> Bool Source #

nonDetOccEnvElts :: OccEnv a -> [a] Source #

foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b Source #

plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a Source #

plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a Source #

extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a Source #

extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b Source #

filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt Source #

delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a Source #

delFromOccEnv :: OccEnv a -> OccName -> OccEnv a Source #

alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt Source #

minusOccEnv :: OccEnv a -> OccEnv b -> OccEnv a Source #

minusOccEnv_C :: (a -> b -> Maybe a) -> OccEnv a -> OccEnv b -> OccEnv a Source #

Alters (replaces or removes) those elements of the map that are mentioned in the second map

pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc Source #

# The `OccSet` type

type OccSet = UniqSet OccName Source #

emptyOccSet :: OccSet Source #

unitOccSet :: OccName -> OccSet Source #

mkOccSet :: [OccName] -> OccSet Source #

extendOccSet :: OccSet -> OccName -> OccSet Source #

extendOccSetList :: OccSet -> [OccName] -> OccSet Source #

unionOccSets :: OccSet -> OccSet -> OccSet Source #

unionManyOccSets :: [OccSet] -> OccSet Source #

minusOccSet :: OccSet -> OccSet -> OccSet Source #

elemOccSet :: OccName -> OccSet -> Bool Source #

isEmptyOccSet :: OccSet -> Bool Source #

intersectOccSet :: OccSet -> OccSet -> OccSet Source #

filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet Source #

occSetToEnv :: OccSet -> OccEnv OccName Source #

Converts an OccSet to an OccEnv (operationally the identity)

# Tidying up

type TidyOccEnv = UniqFM FastString Int Source #

emptyTidyOccEnv :: TidyOccEnv Source #

initTidyOccEnv :: [OccName] -> TidyOccEnv Source #

tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) Source #

avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv Source #

delTidyOccEnvList :: TidyOccEnv -> [FastString] -> TidyOccEnv Source #

type FastStringEnv a = UniqFM FastString a Source #

A non-deterministic set of FastStrings. See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM for explanation why it's not deterministic and why it matters. Use DFastStringEnv if the set eventually gets converted into a list or folded over in a way where the order changes the generated code.

emptyFsEnv :: FastStringEnv a Source #

lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a Source #

extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a Source #

mkFsEnv :: [(FastString, a)] -> FastStringEnv a Source #