ghc-9.13: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Rename.Unbound

Synopsis

Documentation

unknownNameSuggestions :: LocalRdrEnv -> WhatLooking -> RdrName -> RnM ([ImportError], [GhcHint]) Source #

Called from the typechecker (GHC.Tc.Errors) when we find an unbound variable

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 K { f1 = True, f2 = False }, if f2 is not in scope, suggest only constructor fields

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

Instances details
Eq WhatLooking Source # 
Instance details

Defined in GHC.Tc.Errors.Types

Show WhatLooking Source # 
Instance details

Defined in GHC.Tc.Errors.Types

data LookingFor Source #

Constructors

LF 

relevantNameSpace Source #

Arguments

:: Bool

is -XDataKinds enabled?

-> WhatLooking

what are we looking for?

-> NameSpace

is this NameSpace relevant?

-> Bool 

Is a NameSpace relevant for what we are looking for?

suggestionIsRelevant Source #

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 NameSpace, but passing the whole OccName is convenient for debugging.

-> Bool 

Is it OK to suggest an identifier in some other NameSpace, given what we are looking for?

See Note [Related name spaces]