Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data NameSpace
- nameSpacesRelated :: NameSpace -> NameSpace -> Bool
- tcName :: NameSpace
- clsName :: NameSpace
- tcClsName :: NameSpace
- dataName :: NameSpace
- varName :: NameSpace
- tvName :: NameSpace
- srcDataName :: NameSpace
- pprNameSpace :: NameSpace -> SDoc
- pprNonVarNameSpace :: NameSpace -> SDoc
- pprNameSpaceBrief :: NameSpace -> SDoc
- data OccName
- pprOccName :: OccName -> SDoc
- 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
- class HasOccName name where
- 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 -> OccSet -> OccName
- mkDataCOcc :: OccName -> OccSet -> 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
- mkVectOcc :: Maybe String -> OccName -> OccName
- mkVectTyConOcc :: Maybe String -> OccName -> OccName
- mkVectDataConOcc :: Maybe String -> OccName -> OccName
- mkVectIsoOcc :: Maybe String -> OccName -> OccName
- mkPDataTyConOcc :: Maybe String -> OccName -> OccName
- mkPDataDataConOcc :: Maybe String -> OccName -> OccName
- mkPDatasTyConOcc :: Maybe String -> OccName -> OccName
- mkPDatasDataConOcc :: Maybe String -> OccName -> OccName
- mkPReprTyConOcc :: Maybe String -> OccName -> OccName
- mkPADFunOcc :: Maybe String -> OccName -> OccName
- mkRecFldSelOcc :: String -> 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
- occEnvElts :: 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
- 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
- intersectsOccSet :: OccSet -> OccSet -> Bool
- filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
- type TidyOccEnv = UniqFM Int
- emptyTidyOccEnv :: TidyOccEnv
- initTidyOccEnv :: [OccName] -> TidyOccEnv
- tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
- avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
- type FastStringEnv a = UniqFM 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
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.
Pretty Printing
pprNameSpace :: NameSpace -> SDoc Source #
pprNonVarNameSpace :: NameSpace -> SDoc Source #
pprNameSpaceBrief :: NameSpace -> SDoc Source #
The OccName
type
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
Eq OccName Source # | |
Data OccName Source # | |
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName # toConstr :: OccName -> Constr # dataTypeOf :: OccName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) # gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # | |
Ord OccName Source # | |
NFData OccName Source # | |
OutputableBndr OccName Source # | |
Outputable OccName Source # | |
Uniquable OccName Source # | |
Binary OccName Source # | |
HasOccName OccName Source # | |
pprOccName :: OccName -> SDoc Source #
Construction
mkOccNameFS :: NameSpace -> FastString -> OccName Source #
mkVarOccFS :: FastString -> OccName Source #
mkDataOccFS :: FastString -> OccName Source #
mkTyVarOcc :: String -> OccName Source #
mkTyVarOccFS :: FastString -> OccName Source #
mkTcOccFS :: FastString -> OccName Source #
mkClsOccFS :: FastString -> 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.
Instances
HasOccName Name Source # | |
HasOccName OccName Source # | |
HasOccName RdrName Source # | |
HasOccName Var Source # | |
HasOccName IfaceConDecl Source # | |
occName :: IfaceConDecl -> OccName Source # | |
HasOccName IfaceClassOp Source # | |
occName :: IfaceClassOp -> OccName Source # | |
HasOccName IfaceDecl Source # | |
HasOccName TcBinder Source # | |
HasOccName name => HasOccName (IEWrappedName name) Source # | |
occName :: IEWrappedName name -> OccName Source # |
Derived OccName
s
isDerivedOccName :: OccName -> Bool Source #
Test for definitions internally generated by GHC. This predicte 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 TcTypeable.
mkNewTyCoOcc :: OccName -> OccName Source #
mkClassOpAuxOcc :: OccName -> OccName Source #
mkCon2TagOcc :: OccName -> OccName Source #
mkTag2ConOcc :: OccName -> OccName Source #
mkMaxTagOcc :: OccName -> OccName Source #
mkClassDataConOcc :: OccName -> OccName Source #
mkForeignExportOcc :: OccName -> OccName Source #
mkRepEqOcc :: OccName -> OccName Source #
mkDataConWorkerOcc :: OccName -> OccName Source #
mkMethodOcc :: OccName -> OccName Source #
Derive a name for the representation type constructor of a
data
/newtype
instance.
mkInstTyCoOcc :: OccName -> OccName Source #
mkEqPredCoOcc :: OccName -> OccName Source #
mkRecFldSelOcc :: String -> OccName Source #
mkTyConRepOcc :: OccName -> OccName Source #
Deconstruction
occNameFS :: OccName -> FastString Source #
occNameString :: OccName -> String Source #
occNameSpace :: OccName -> NameSpace 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
startsWithUnderscore :: OccName -> Bool Source #
Haskell 98 encourages compilers to suppress warnings about unsed
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
Instances
Data a => Data (OccEnv a) Source # | |
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccEnv a -> c (OccEnv a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OccEnv a) # toConstr :: OccEnv a -> Constr # dataTypeOf :: OccEnv a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OccEnv a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OccEnv a)) # gmapT :: (forall b. Data b => b -> b) -> OccEnv a -> OccEnv a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r # gmapQ :: (forall d. Data d => d -> u) -> OccEnv a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccEnv a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # | |
Outputable a => Outputable (OccEnv a) Source # | |
emptyOccEnv :: OccEnv a Source #
unitOccEnv :: OccName -> a -> OccEnv a Source #
mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a Source #
occEnvElts :: OccEnv a -> [a] Source #
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b Source #
The OccSet
type
emptyOccSet :: OccSet Source #
unitOccSet :: OccName -> OccSet Source #
unionManyOccSets :: [OccSet] -> OccSet Source #
isEmptyOccSet :: OccSet -> Bool Source #
Tidying up
type TidyOccEnv = UniqFM Int Source #
initTidyOccEnv :: [OccName] -> TidyOccEnv Source #
tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) Source #
avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv Source #
type FastStringEnv a = UniqFM a Source #
A non-deterministic set of FastStrings. See Note [Deterministic UniqFM] in UniqDFM 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 #