ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Tc.Errors.Hole.FitTypes

Synopsis

- data TypedHole = TypedHole {
  - th_relevant_cts :: Bag CtEvidence
  - th_implics :: [Implication]
  - th_hole :: Maybe Hole
  }
- data HoleFit
  - = TcHoleFit TcHoleFit
  - | RawHoleFit SDoc
- data TcHoleFit = HoleFit {
  - hfId :: Id
  - hfCand :: HoleFitCandidate
  - hfType :: TcType
  - hfRefLvl :: Int
  - hfWrap :: [TcType]
  - hfMatches :: [TcType]
  - hfDoc :: Maybe [HsDocString]
  }
- data HoleFitCandidate
  - = IdHFCand Id
  - | NameHFCand Name
  - | GreHFCand GlobalRdrElt
- hfIsLcl :: TcHoleFit -> Bool
- pprHoleFitCand :: HoleFitCandidate -> SDoc

# Documentation

data TypedHole #

Constructors

TypedHole |
Fields th_relevant_cts :: Bag CtEvidence Any relevant Cts to the hole th_implics :: [Implication] The nested implications of the hole with the innermost implication first. th_hole :: Maybe Hole The hole itself, if available.

#### Instances

Instances details

Outputable TypedHole # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods ppr :: TypedHole -> SDoc #

data HoleFit #

Constructors

TcHoleFit TcHoleFit |
RawHoleFit SDoc | A fit that is just displayed as is. Here so that HoleFitPlugins can inject any fit they want.

#### Instances

Instances details

Outputable HoleFit # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods ppr :: HoleFit -> SDoc #

data TcHoleFit #

HoleFit is the type we use for valid hole fits. It contains the element that was checked, the Id of that element as found by `tcLookup`, and the refinement level of the fit, which is the number of extra argument holes that this fit uses (e.g. if hfRefLvl is 2, the fit is for `Id _ _`).

Constructors

HoleFit |
Fields hfId :: Id The elements id in the TcM hfCand :: HoleFitCandidate The candidate that was checked. hfType :: TcType The type of the id, possibly zonked. hfRefLvl :: Int The number of holes in this fit. hfWrap :: [TcType] The wrapper for the match. hfMatches :: [TcType] What the refinement variables got matched with, if anything hfDoc :: Maybe [HsDocString] Documentation of this HoleFit, if available.

#### Instances

Instances details

Outputable TcHoleFit # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods ppr :: TcHoleFit -> SDoc #
Eq TcHoleFit # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods (==) :: TcHoleFit -> TcHoleFit -> Bool # (/=) :: TcHoleFit -> TcHoleFit -> Bool #
Ord TcHoleFit # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods compare :: TcHoleFit -> TcHoleFit -> Ordering # (<) :: TcHoleFit -> TcHoleFit -> Bool # (<=) :: TcHoleFit -> TcHoleFit -> Bool # (>) :: TcHoleFit -> TcHoleFit -> Bool # (>=) :: TcHoleFit -> TcHoleFit -> Bool # max :: TcHoleFit -> TcHoleFit -> TcHoleFit # min :: TcHoleFit -> TcHoleFit -> TcHoleFit #

data HoleFitCandidate #

HoleFitCandidates are passed to hole fit plugins and then checked whether they fit a given typed-hole.

Constructors

IdHFCand Id |
NameHFCand Name |
GreHFCand GlobalRdrElt |

#### Instances

Instances details

NamedThing HoleFitCandidate # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods getOccName :: HoleFitCandidate -> OccName # getName :: HoleFitCandidate -> Name #
HasOccName HoleFitCandidate # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods occName :: HoleFitCandidate -> OccName #
Outputable HoleFitCandidate # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods ppr :: HoleFitCandidate -> SDoc #
Eq HoleFitCandidate # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods (==) :: HoleFitCandidate -> HoleFitCandidate -> Bool # (/=) :: HoleFitCandidate -> HoleFitCandidate -> Bool #
Ord HoleFitCandidate # |
Instance details Defined in GHC.Tc.Errors.Hole.FitTypes Methods compare :: HoleFitCandidate -> HoleFitCandidate -> Ordering # (<) :: HoleFitCandidate -> HoleFitCandidate -> Bool # (<=) :: HoleFitCandidate -> HoleFitCandidate -> Bool # (>) :: HoleFitCandidate -> HoleFitCandidate -> Bool # (>=) :: HoleFitCandidate -> HoleFitCandidate -> Bool # max :: HoleFitCandidate -> HoleFitCandidate -> HoleFitCandidate # min :: HoleFitCandidate -> HoleFitCandidate -> HoleFitCandidate #

hfIsLcl :: TcHoleFit -> Bool #

pprHoleFitCand :: HoleFitCandidate -> SDoc #