RnEnv

ghc-8.4.2: 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
- lookupKindOccRn :: 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 -> SDoc -> 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 Source #

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

lookupTopBndrRn :: RdrName -> RnM Name Source #

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

lookupOccRn :: RdrName -> RnM Name Source #

lookupOccRn_maybe :: RdrName -> RnM (Maybe Name) Source #

lookupLocalOccRn_maybe :: RdrName -> RnM (Maybe Name) Source #

lookupInfoOccRn :: RdrName -> RnM [Name] Source #

lookupLocalOccThLvl_maybe :: Name -> RnM (Maybe (TopLevelFlag, ThLevel)) Source #

lookupLocalOccRn :: RdrName -> RnM Name Source #

lookupTypeOccRn :: RdrName -> RnM Name Source #

lookupKindOccRn :: RdrName -> RnM Name Source #

lookupGlobalOccRn :: RdrName -> RnM Name Source #

lookupGlobalOccRn_maybe :: RdrName -> RnM (Maybe Name) Source #

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

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

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 Source #

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

data ChildLookupResult Source #

Constructors

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

Instances

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

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

Used in export lists to lookup the children.

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

Specialised version of msum for RnM ChildLookupResult

data HsSigCtxt Source #

Constructors

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

Instances

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

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

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

lookupSigCtxtOccRn Source #

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 Source #

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

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

lookupConstructorFields :: Name -> RnM [FieldLabel] Source #

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

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

lookupSyntaxName' Source #

Arguments

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

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

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

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

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

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

dataTcOccs :: RdrName -> [RdrName] Source #