Safe Haskell | None |
---|---|
Language | GHC2021 |
GHC.Rename.Unbound
Synopsis
- mkUnboundName :: OccName -> Name
- mkUnboundNameRdr :: RdrName -> Name
- mkUnboundGRE :: OccName -> GlobalRdrElt
- mkUnboundGRERdr :: RdrName -> GlobalRdrElt
- isUnboundName :: Name -> Bool
- reportUnboundName :: WhatLooking -> RdrName -> RnM Name
- unknownNameSuggestions :: LocalRdrEnv -> WhatLooking -> RdrName -> RnM ([ImportError], [GhcHint])
- unknownNameSuggestionsMessage :: TcRnMessage -> [ImportError] -> [GhcHint] -> RnM TcRnMessage
- similarNameSuggestions :: LookingFor -> DynFlags -> GlobalRdrEnv -> LocalRdrEnv -> RdrName -> [SimilarName]
- fieldSelectorSuggestions :: GlobalRdrEnv -> RdrName -> [GhcHint]
- data WhatLooking
- data WhereLooking
- data LookingFor = LF {}
- unboundName :: LookingFor -> RdrName -> RnM Name
- unboundNameX :: LookingFor -> RdrName -> [GhcHint] -> RnM Name
- unboundTermNameInTypes :: LookingFor -> RdrName -> RdrName -> RnM Name
- data IsTermInTypes
- notInScopeErr :: WhereLooking -> RdrName -> NotInScopeError
- relevantNameSpace :: Bool -> WhatLooking -> NameSpace -> Bool
- suggestionIsRelevant :: DynFlags -> WhatLooking -> OccName -> Bool
- termNameInType :: LookingFor -> RdrName -> RdrName -> [GhcHint] -> RnM Name
Documentation
mkUnboundName :: OccName -> Name Source #
mkUnboundNameRdr :: RdrName -> Name Source #
mkUnboundGRE :: OccName -> GlobalRdrElt Source #
isUnboundName :: Name -> Bool Source #
reportUnboundName :: WhatLooking -> RdrName -> RnM Name Source #
unknownNameSuggestions :: LocalRdrEnv -> WhatLooking -> RdrName -> RnM ([ImportError], [GhcHint]) Source #
Called from the typechecker (GHC.Tc.Errors) when we find an unbound variable
unknownNameSuggestionsMessage :: TcRnMessage -> [ImportError] -> [GhcHint] -> RnM TcRnMessage Source #
similarNameSuggestions :: LookingFor -> DynFlags -> GlobalRdrEnv -> LocalRdrEnv -> RdrName -> [SimilarName] Source #
fieldSelectorSuggestions :: GlobalRdrEnv -> RdrName -> [GhcHint] Source #
When the name is in scope as field whose selector has been suppressed by NoFieldSelectors, display a helpful message explaining this.
data WhatLooking Source #
Constructors
WL_Anything | Any sugestion |
WL_Constructor | Suggest type constructors, data constructors (including promoted data constructors), and pattern synonyms. |
WL_TyCon | Suggest type constructors/classes only; do not include promoted data constructors. |
WL_TyCon_or_TermVar | Suggest type constructors and term variables, but not data constructors nor type variables |
WL_TyVar | Suggest type variables only. |
WL_ConLike | Suggest term-level data constructors and pattern synonyms; no type constructors or promoted data constructors |
WL_RecField | Suggest record fields E.g. in |
WL_Term | Suggest terms If we are expecting a term value, then only suggest terms (e.g. term variables, data constructors) and not type constructors or type variables |
WL_TermVariable | Suggest term variables (and record fields) |
WL_Type | Suggest types: type constructors, type variables, promoted data constructors. |
WL_None | No suggestions This is is used for rebindable syntax, where there is no point in suggesting alternative spellings |
Instances
Eq WhatLooking Source # | |
Defined in GHC.Tc.Errors.Types | |
Show WhatLooking Source # | |
Defined in GHC.Tc.Errors.Types Methods showsPrec :: Int -> WhatLooking -> ShowS # show :: WhatLooking -> String # showList :: [WhatLooking] -> ShowS # |
data WhereLooking Source #
Constructors
WL_Anywhere | |
WL_Global | |
WL_LocalTop | |
WL_LocalOnly |
data LookingFor Source #
Constructors
LF | |
Fields |
unboundName :: LookingFor -> RdrName -> RnM Name Source #
unboundNameX :: LookingFor -> RdrName -> [GhcHint] -> RnM Name Source #
unboundTermNameInTypes :: LookingFor -> RdrName -> RdrName -> RnM Name Source #
data IsTermInTypes Source #
Constructors
UnknownTermInTypes RdrName | |
TermInTypes RdrName | |
NoTermInTypes |
notInScopeErr :: WhereLooking -> RdrName -> NotInScopeError Source #
Arguments
:: Bool | is |
-> WhatLooking | what are we looking for? |
-> NameSpace | is this |
-> Bool |
Is a NameSpace
relevant for what we are looking for?
Arguments
:: DynFlags | to find out whether -XDataKinds is enabled |
-> WhatLooking | What kind of name are we looking for? |
-> OccName | The suggestion We only look at the suggestion's |
-> Bool |
Is it OK to suggest an identifier in some other NameSpace
,
given what we are looking for?
See Note [Related name spaces]
termNameInType :: LookingFor -> RdrName -> RdrName -> [GhcHint] -> RnM Name Source #