| 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]
- anyQualImportSuggestions :: LookingFor -> LookupGRE GREInfo -> TcM [ImportSuggestion]
- 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.
anyQualImportSuggestions :: LookingFor -> LookupGRE GREInfo -> TcM [ImportSuggestion] Source #
Provide import suggestions, without filtering by module qualification.
Used to suggest imports for HasField, which doesn't care about whether a
name is imported qualified or unqualified.
For example:
import M1 () -- M1 exports fld1 import qualified M2 hiding ( fld2 ) x r = r.fld1 -- suggest adding 'fld1' to M1 import y r = getField @"fld2" r -- suggest unhiding 'fld' from M2 import
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 Methods (==) :: WhatLooking -> WhatLooking -> Bool Source # (/=) :: WhatLooking -> WhatLooking -> Bool Source # | |
| Show WhatLooking Source # | |
Defined in GHC.Tc.Errors.Types | |
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 #