Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- newTopSrcBinder :: LocatedN RdrName -> RnM Name
- lookupLocatedTopBndrRn :: Located RdrName -> RnM (Located Name)
- lookupLocatedTopBndrRnN :: LocatedN RdrName -> RnM (LocatedN Name)
- lookupTopBndrRn :: WhatLooking -> RdrName -> RnM Name
- lookupLocatedTopConstructorRn :: Located RdrName -> RnM (Located Name)
- lookupLocatedTopConstructorRnN :: LocatedN RdrName -> RnM (LocatedN Name)
- lookupLocatedOccRn :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name)
- lookupLocatedOccRnConstr :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name)
- lookupLocatedOccRnRecField :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name)
- lookupLocatedOccRnNone :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name)
- lookupOccRn :: RdrName -> RnM Name
- lookupOccRn_maybe :: RdrName -> RnM (Maybe GlobalRdrElt)
- lookupSameOccRn_maybe :: RdrName -> RnM (Maybe Name)
- lookupLocalOccRn_maybe :: RdrName -> RnM (Maybe Name)
- lookupInfoOccRn :: RdrName -> RnM [Name]
- lookupLocalOccThLvl_maybe :: Name -> RnM (Maybe (TopLevelFlag, ThLevel))
- lookupLocalOccRn :: RdrName -> RnM Name
- lookupTypeOccRn :: RdrName -> RnM Name
- lookupGlobalOccRn :: RdrName -> RnM Name
- lookupGlobalOccRn_maybe :: WhichGREs GREInfo -> RdrName -> RnM (Maybe GlobalRdrElt)
- lookupExprOccRn :: RdrName -> RnM (Maybe GlobalRdrElt)
- lookupRecFieldOcc :: Maybe Name -> RdrName -> RnM Name
- lookupRecUpdFields :: NonEmpty (LHsRecUpdField GhcPs GhcPs) -> RnM (NonEmpty (HsRecUpdParent GhcRn))
- getFieldUpdLbl :: forall (p :: Pass) q. LHsRecUpdField (GhcPass p) q -> LocatedN RdrName
- getUpdFieldLbls :: forall (p :: Pass) q. UnXRec (GhcPass p) => [LHsRecUpdField (GhcPass p) q] -> [RdrName]
- data ChildLookupResult
- lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings -> Name -> RdrName -> LookupChild -> RnM ChildLookupResult
- data HsSigCtxt
- lookupLocalTcNames :: HsSigCtxt -> SDoc -> NamespaceSpecifier -> RdrName -> RnM [(RdrName, Name)]
- lookupSigOccRn :: HsSigCtxt -> Sig GhcPs -> LocatedA RdrName -> RnM (LocatedA Name)
- lookupSigOccRnN :: HsSigCtxt -> Sig GhcPs -> LocatedN RdrName -> RnM (LocatedN Name)
- lookupSigCtxtOccRn :: HsSigCtxt -> SDoc -> GenLocated (EpAnn ann) RdrName -> RnM (GenLocated (EpAnn ann) Name)
- lookupInstDeclBndr :: Name -> SDoc -> RdrName -> RnM Name
- lookupFamInstName :: Maybe Name -> LocatedN RdrName -> RnM (LocatedN Name)
- lookupConstructorInfo :: HasDebugCallStack => Name -> RnM ConInfo
- lookupConstructorFields :: HasDebugCallStack => Name -> RnM [FieldLabel]
- lookupGREInfo :: HasDebugCallStack => HscEnv -> Name -> GREInfo
- lookupGreAvailRn :: RdrName -> RnM (Maybe GlobalRdrElt)
- lookupSyntax :: Name -> RnM (SyntaxExpr GhcRn, FreeVars)
- lookupSyntaxExpr :: Name -> RnM (HsExpr GhcRn, FreeVars)
- lookupSyntaxNames :: [Name] -> RnM ([HsExpr GhcRn], FreeVars)
- lookupSyntaxName :: Name -> RnM (Name, FreeVars)
- lookupIfThenElse :: RnM (Maybe Name)
- lookupQualifiedDoExpr :: HsStmtContext fn -> Name -> RnM (HsExpr GhcRn, FreeVars)
- lookupQualifiedDo :: HsStmtContext fn -> Name -> RnM (SyntaxExpr GhcRn, FreeVars)
- lookupQualifiedDoName :: HsStmtContext fn -> Name -> RnM (Name, FreeVars)
- lookupNameWithQualifier :: Name -> ModuleName -> RnM (Name, FreeVars)
- data DeprecationWarnings
- addUsedGRE :: DeprecationWarnings -> GlobalRdrElt -> RnM ()
- addUsedGREs :: DeprecationWarnings -> [GlobalRdrElt] -> RnM ()
- addUsedDataCons :: GlobalRdrEnv -> TyCon -> RnM ()
- dataTcOccs :: RdrName -> [RdrName]
Documentation
lookupTopBndrRn :: WhatLooking -> RdrName -> RnM Name Source #
lookupLocatedOccRn :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name) Source #
lookupLocatedOccRnConstr :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name) Source #
lookupLocatedOccRnRecField :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name) Source #
lookupLocatedOccRnNone :: GenLocated (EpAnn ann) RdrName -> TcRn (GenLocated (EpAnn ann) Name) Source #
lookupOccRn_maybe :: RdrName -> RnM (Maybe GlobalRdrElt) Source #
lookupInfoOccRn :: RdrName -> RnM [Name] Source #
lookupInfoOccRn is intended for use in GHCi's ":info" command It finds all the GREs that RdrName could mean, not complaining about ambiguity, but rather returning them all (c.f. #9881).
lookupInfoOccRn is also used in situations where we check for at least one definition of the RdrName, not complaining about multiple definitions (see #17832).
lookupLocalOccThLvl_maybe :: Name -> RnM (Maybe (TopLevelFlag, ThLevel)) Source #
lookupGlobalOccRn_maybe :: WhichGREs GREInfo -> RdrName -> RnM (Maybe GlobalRdrElt) Source #
lookupExprOccRn :: RdrName -> RnM (Maybe GlobalRdrElt) Source #
Look up a RdrName
used as a variable in an expression.
This may be a local variable, global variable, or one or more record selector
functions. It will not return record fields created with the
NoFieldSelectors
extension (see Note [NoFieldSelectors]).
If the name is not in scope at the term level, but its promoted equivalent is in scope at the type level, the lookup will succeed (so that the type-checker can report a more informative error later). See Note [Promotion].
lookupRecFieldOcc :: Maybe Name -> RdrName -> RnM Name Source #
Look up an occurrence of a field in record construction or pattern matching (but not update).
If -XDisambiguateRecordFields is off, then we will pass Nothing
for the
DataCon
Name
, i.e. we don't use the data constructor for disambiguation.
See Note [DisambiguateRecordFields] and Note [NoFieldSelectors].
lookupRecUpdFields :: NonEmpty (LHsRecUpdField GhcPs GhcPs) -> RnM (NonEmpty (HsRecUpdParent GhcRn)) Source #
Returns all possible collections of field labels for the given record update.
Example:
data D = MkD { fld1 :: Int, fld2 :: Bool } data E = MkE1 { fld1 :: Int, fld2 :: Bool, fld3 :: Char } | MkE2 { fld1 :: Int, fld2 :: Bool } data F = MkF1 { fld1 :: Int } | MkF2 { fld2 :: Bool }
f r = r { fld1 = a, fld2 = b }
This function will return:
- [ D.fld1, D.fld2
- -- could be a record update at type D , [ E.fld1, E.fld2 ] -- could be a record update at type E ] -- cannot be a record update at type F: no constructor has both -- of the fields fld1 and fld2
If there are no valid parents for the record update,
throws a TcRnBadRecordUpdate
error.
getFieldUpdLbl :: forall (p :: Pass) q. LHsRecUpdField (GhcPass p) q -> LocatedN RdrName Source #
getUpdFieldLbls :: forall (p :: Pass) q. UnXRec (GhcPass p) => [LHsRecUpdField (GhcPass p) q] -> [RdrName] Source #
data ChildLookupResult Source #
NameNotFound | We couldn't find a suitable name |
IncorrectParent | The child has an incorrect parent |
| |
FoundChild GlobalRdrElt |
Instances
Outputable ChildLookupResult Source # | |
Defined in GHC.Rename.Env ppr :: ChildLookupResult -> SDoc Source # |
lookupSubBndrOcc_helper Source #
:: Bool | |
-> DeprecationWarnings | |
-> Name | |
-> RdrName | thing we are looking up |
-> LookupChild | how to look it up (e.g. which
|
-> RnM ChildLookupResult |
Used in export lists to lookup the children.
TopSigCtxt NameSet | |
LocalBindCtxt NameSet | |
ClsDeclCtxt Name | |
InstDeclCtxt NameSet | |
HsBootCtxt NameSet | |
RoleAnnotCtxt NameSet |
Instances
lookupLocalTcNames :: HsSigCtxt -> SDoc -> NamespaceSpecifier -> RdrName -> RnM [(RdrName, Name)] Source #
:: HsSigCtxt | |
-> SDoc | description of thing we're looking up, like "type family" |
-> GenLocated (EpAnn ann) RdrName | |
-> RnM (GenLocated (EpAnn ann) Name) |
Lookup a name in relation to the names in a HsSigCtxt
lookupConstructorInfo :: HasDebugCallStack => Name -> RnM ConInfo Source #
Look up the arity and record fields of a constructor.
lookupConstructorFields :: HasDebugCallStack => Name -> RnM [FieldLabel] Source #
lookupGREInfo :: HasDebugCallStack => HscEnv -> Name -> GREInfo Source #
lookupGreAvailRn :: RdrName -> RnM (Maybe GlobalRdrElt) Source #
lookupSyntax :: Name -> RnM (SyntaxExpr GhcRn, FreeVars) Source #
:: Name | The standard name |
-> RnM (Name, FreeVars) | Possibly a non-standard name Lookup a Name that may be subject to Rebindable Syntax (RS).
|
lookupQualifiedDoExpr :: HsStmtContext fn -> Name -> RnM (HsExpr GhcRn, FreeVars) Source #
lookupQualifiedDo :: HsStmtContext fn -> Name -> RnM (SyntaxExpr GhcRn, FreeVars) Source #
lookupQualifiedDoName :: HsStmtContext fn -> Name -> RnM (Name, FreeVars) Source #
lookupNameWithQualifier :: Name -> ModuleName -> RnM (Name, FreeVars) Source #
data DeprecationWarnings Source #
Whether to report deprecation warnings when registering a used GRE
There is no option to only emit declaration warnings since everywhere we emit the declaration warnings we also emit export warnings (See Note [Handling of deprecations] for details)
addUsedGRE :: DeprecationWarnings -> GlobalRdrElt -> RnM () Source #
addUsedGREs :: DeprecationWarnings -> [GlobalRdrElt] -> RnM () Source #
addUsedDataCons :: GlobalRdrEnv -> TyCon -> RnM () Source #
dataTcOccs :: RdrName -> [RdrName] Source #