GHC.Rename.Unbound

ghc-9.10.0.20240328: The GHC API

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 :: RdrName -> RnM Name
- reportUnboundName' :: WhatLooking -> RdrName -> RnM Name
- unknownNameSuggestions :: LocalRdrEnv -> WhatLooking -> RdrName -> RnM ([ImportError], [GhcHint])
- similarNameSuggestions :: LookingFor -> DynFlags -> GlobalRdrEnv -> LocalRdrEnv -> RdrName -> [SimilarName]
- fieldSelectorSuggestions :: GlobalRdrEnv -> RdrName -> [GhcHint]
- data WhatLooking
  - = WL_Anything
  - | WL_Constructor
  - | WL_RecField
  - | WL_None
- data WhereLooking
  - = WL_Anywhere
  - | WL_Global
  - | WL_LocalTop
  - | WL_LocalOnly
- data LookingFor = LF {
  - lf_which :: WhatLooking
  - lf_where :: WhereLooking
  }
- unboundName :: LookingFor -> RdrName -> RnM Name
- unboundNameX :: LookingFor -> RdrName -> [GhcHint] -> RnM Name
- unboundTermNameInTypes :: LookingFor -> RdrName -> RdrName -> RnM Name
- data IsTermInTypes
  - = UnknownTermInTypes RdrName
  - | TermInTypes RdrName
  - | NoTermInTypes
- notInScopeErr :: WhereLooking -> RdrName -> NotInScopeError
- nameSpacesRelated :: DynFlags -> WhatLooking -> NameSpace -> NameSpace -> Bool
- termNameInType :: LookingFor -> RdrName -> RdrName -> [GhcHint] -> RnM Name

# Documentation

mkUnboundName :: OccName -> Name Source #

mkUnboundNameRdr :: RdrName -> Name Source #

mkUnboundGRE :: OccName -> GlobalRdrElt Source #

mkUnboundGRERdr :: RdrName -> GlobalRdrElt Source #

isUnboundName :: Name -> Bool Source #

reportUnboundName :: RdrName -> RnM Name 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

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 |
WL_Constructor |
WL_RecField |
WL_None |

#### Instances

Instances details

Eq WhatLooking Source # |
Instance details Defined in GHC.Rename.Unbound Methods (==) :: WhatLooking -> WhatLooking -> Bool # (/=) :: WhatLooking -> WhatLooking -> Bool #

data WhereLooking Source #

Constructors

WL_Anywhere |
WL_Global |
WL_LocalTop |
WL_LocalOnly |

data LookingFor Source #

Constructors

LF |
Fields lf_which :: WhatLooking lf_where :: WhereLooking

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 #

nameSpacesRelated Source #

Arguments

:: DynFlags | to find out whether -XDataKinds is enabled
-> WhatLooking | What kind of name are we looking for
-> NameSpace | Name space of the original name
-> NameSpace | Name space of a name that might have been meant
-> Bool |

termNameInType :: LookingFor -> RdrName -> RdrName -> [GhcHint] -> RnM Name Source #