RnEnv

ghc-8.6.3: The GHC API

Safe Haskell | None
Language | Haskell2010

RnEnv

Synopsis

- newTopSrcBinder :: Located RdrName -> RnM Name
- lookupLocatedTopBndrRn :: Located RdrName -> RnM (Located Name)
- lookupTopBndrRn :: RdrName -> RnM Name
- lookupLocatedOccRn :: Located RdrName -> RnM (Located Name)
- lookupOccRn :: RdrName -> RnM Name
- lookupOccRn_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 :: RdrName -> RnM (Maybe Name)
- lookupOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [Name]))
- lookupGlobalOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [Name]))
- lookupExactOcc :: Name -> RnM Name
- data ChildLookupResult
  - = NameNotFound
  - | IncorrectParent Name Name SDoc [Name]
  - | FoundName Parent Name
  - | FoundFL FieldLabel
- lookupSubBndrOcc_helper :: Bool -> Bool -> Name -> RdrName -> RnM ChildLookupResult
- combineChildLookupResult :: [RnM ChildLookupResult] -> RnM ChildLookupResult
- data HsSigCtxt
  - = TopSigCtxt NameSet
  - | LocalBindCtxt NameSet
  - | ClsDeclCtxt Name
  - | InstDeclCtxt NameSet
  - | HsBootCtxt NameSet
  - | RoleAnnotCtxt NameSet
- lookupLocalTcNames :: HsSigCtxt -> SDoc -> RdrName -> RnM [(RdrName, Name)]
- lookupSigOccRn :: HsSigCtxt -> Sig GhcPs -> Located RdrName -> RnM (Located Name)
- lookupSigCtxtOccRn :: HsSigCtxt -> SDoc -> Located RdrName -> RnM (Located Name)
- lookupInstDeclBndr :: Name -> SDoc -> RdrName -> RnM Name
- lookupRecFieldOcc :: Maybe Name -> RdrName -> RnM Name
- lookupFamInstName :: Maybe Name -> Located RdrName -> RnM (Located Name)
- lookupConstructorFields :: Name -> RnM [FieldLabel]
- lookupGreAvailRn :: RdrName -> RnM (Name, AvailInfo)
- lookupSyntaxName :: Name -> RnM (SyntaxExpr GhcRn, FreeVars)
- lookupSyntaxName' :: Name -> RnM Name
- lookupSyntaxNames :: [Name] -> RnM ([HsExpr GhcRn], FreeVars)
- lookupIfThenElse :: RnM (Maybe (SyntaxExpr GhcRn), FreeVars)
- addUsedGRE :: Bool -> GlobalRdrElt -> RnM ()
- addUsedGREs :: [GlobalRdrElt] -> RnM ()
- addUsedDataCons :: GlobalRdrEnv -> TyCon -> RnM ()
- dataTcOccs :: RdrName -> [RdrName]

# Documentation

newTopSrcBinder :: Located RdrName -> RnM Name #

lookupLocatedTopBndrRn :: Located RdrName -> RnM (Located Name) #

lookupTopBndrRn :: RdrName -> RnM Name #

lookupLocatedOccRn :: Located RdrName -> RnM (Located Name) #

lookupOccRn :: RdrName -> RnM Name #

lookupOccRn_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 :: RdrName -> RnM (Maybe Name) #

lookupOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [Name])) #

lookupGlobalOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [Name])) #

Like `lookupOccRn_maybe`, but with a more informative result if the `RdrName` happens to be a record selector:

- Nothing -> name not in scope (no error reported)
- Just (Left x) -> name uniquely refers to x, or there is a name clash (reported)
- Just (Right xs) -> name refers to one or more record selectors; if overload_ok was False, this list will be a singleton.

lookupExactOcc :: Name -> RnM Name #

Lookup an `Exact` `RdrName`. See Note [Looking up Exact RdrNames]. This adds an error if the name cannot be found.

data ChildLookupResult #

Constructors

NameNotFound |
IncorrectParent Name Name SDoc [Name] |
FoundName Parent Name |
FoundFL FieldLabel |

Instances

Outputable ChildLookupResult # |
Instance details Defined in RnEnv Methods ppr :: ChildLookupResult -> SDoc # pprPrec :: Rational -> ChildLookupResult -> SDoc #

lookupSubBndrOcc_helper :: Bool -> Bool -> Name -> RdrName -> RnM ChildLookupResult #

Used in export lists to lookup the children.

combineChildLookupResult :: [RnM ChildLookupResult] -> RnM ChildLookupResult #

Specialised version of msum for RnM ChildLookupResult

data HsSigCtxt #

Constructors

TopSigCtxt NameSet |
LocalBindCtxt NameSet |
ClsDeclCtxt Name |
InstDeclCtxt NameSet |
HsBootCtxt NameSet |
RoleAnnotCtxt NameSet |

Instances

Outputable HsSigCtxt # |
Instance details Defined in RnEnv Methods ppr :: HsSigCtxt -> SDoc # pprPrec :: Rational -> HsSigCtxt -> SDoc #

lookupLocalTcNames :: HsSigCtxt -> SDoc -> RdrName -> RnM [(RdrName, Name)] #

lookupSigOccRn :: HsSigCtxt -> Sig GhcPs -> Located RdrName -> RnM (Located Name) #

lookupSigCtxtOccRn #

Arguments

:: HsSigCtxt |
-> SDoc | description of thing we're looking up, like "type family"
-> Located RdrName |
-> RnM (Located Name) |

Lookup a name in relation to the names in a `HsSigCtxt`

lookupInstDeclBndr :: Name -> SDoc -> RdrName -> RnM Name #

lookupRecFieldOcc :: Maybe Name -> RdrName -> RnM Name #

Look up an occurrence of a field in record construction or pattern matching (but not update). When the -XDisambiguateRecordFields flag is on, take account of the data constructor name to disambiguate which field to use.

See Note [DisambiguateRecordFields].

lookupFamInstName :: Maybe Name -> Located RdrName -> RnM (Located Name) #

lookupConstructorFields :: Name -> RnM [FieldLabel] #

lookupGreAvailRn :: RdrName -> RnM (Name, AvailInfo) #

lookupSyntaxName :: Name -> RnM (SyntaxExpr GhcRn, FreeVars) #

lookupSyntaxName' #

Arguments

:: Name | The standard name
-> RnM Name | Possibly a non-standard name

lookupSyntaxNames :: [Name] -> RnM ([HsExpr GhcRn], FreeVars) #

lookupIfThenElse :: RnM (Maybe (SyntaxExpr GhcRn), FreeVars) #

addUsedGRE :: Bool -> GlobalRdrElt -> RnM () #

addUsedGREs :: [GlobalRdrElt] -> RnM () #

addUsedDataCons :: GlobalRdrEnv -> TyCon -> RnM () #

dataTcOccs :: RdrName -> [RdrName] #