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

Safe Haskell | Ignore
Language | GHC2021

GHC.Tc.Types.Evidence

Contents

- HsWrapper
- Evidence bindings
- EvTerm (already a CoreExpr)
- HoleExprRef
- TcCoercion
- QuoteWrapper

Synopsis

- data HsWrapper
  - = WpHole
  - | WpCompose HsWrapper HsWrapper
  - | WpFun HsWrapper HsWrapper (Scaled TcTypeFRR)
  - | WpCast TcCoercionR
  - | WpEvLam EvVar
  - | WpEvApp EvTerm
  - | WpTyLam TyVar
  - | WpTyApp KindOrType
  - | WpLet TcEvBinds
  - | WpMultCoercion Coercion
- (<.>) :: HsWrapper -> HsWrapper -> HsWrapper
- mkWpTyApps :: [Type] -> HsWrapper
- mkWpEvApps :: [EvTerm] -> HsWrapper
- mkWpEvVarApps :: [EvVar] -> HsWrapper
- mkWpTyLams :: [TyVar] -> HsWrapper
- mkWpVisTyLam :: TyVar -> Type -> HsWrapper
- mkWpEvLams :: [Var] -> HsWrapper
- mkWpLet :: TcEvBinds -> HsWrapper
- mkWpFun :: HsWrapper -> HsWrapper -> Scaled TcTypeFRR -> TcType -> HsWrapper
- mkWpCastN :: TcCoercionN -> HsWrapper
- mkWpCastR :: TcCoercionR -> HsWrapper
- mkWpEta :: [Id] -> HsWrapper -> HsWrapper
- collectHsWrapBinders :: HsWrapper -> ([Var], HsWrapper)
- idHsWrapper :: HsWrapper
- isIdHsWrapper :: HsWrapper -> Bool
- pprHsWrapper :: HsWrapper -> (Bool -> SDoc) -> SDoc
- hsWrapDictBinders :: HsWrapper -> Bag DictId
- data TcEvBinds
  - = TcEvBinds EvBindsVar
  - | EvBinds (Bag EvBind)
- data EvBindsVar
  - = EvBindsVar {
    - ebv_uniq :: Unique
    - ebv_binds :: IORef EvBindMap
    - ebv_tcvs :: IORef CoVarSet
    }
  - | CoEvBindsVar {
    - ebv_uniq :: Unique
    - ebv_tcvs :: IORef CoVarSet
    }
- newtype EvBindMap = EvBindMap {
  - ev_bind_varenv :: DVarEnv EvBind
  }
- emptyEvBindMap :: EvBindMap
- extendEvBinds :: EvBindMap -> EvBind -> EvBindMap
- lookupEvBind :: EvBindMap -> EvVar -> Maybe EvBind
- evBindMapBinds :: EvBindMap -> Bag EvBind
- foldEvBindMap :: (EvBind -> a -> a) -> a -> EvBindMap -> a
- nonDetStrictFoldEvBindMap :: (EvBind -> a -> a) -> a -> EvBindMap -> a
- filterEvBindMap :: (EvBind -> Bool) -> EvBindMap -> EvBindMap
- isEmptyEvBindMap :: EvBindMap -> Bool
- evBindMapToVarSet :: EvBindMap -> VarSet
- varSetMinusEvBindMap :: VarSet -> EvBindMap -> VarSet
- data EvBindInfo
  - = EvBindGiven
  - | EvBindWanted {
    - ebi_canonical :: Canonical
    }
- data EvBind = EvBind {
  - eb_lhs :: EvVar
  - eb_rhs :: EvTerm
  - eb_info :: EvBindInfo
  }
- emptyTcEvBinds :: TcEvBinds
- isEmptyTcEvBinds :: TcEvBinds -> Bool
- mkGivenEvBind :: EvVar -> EvTerm -> EvBind
- mkWantedEvBind :: EvVar -> Canonical -> EvTerm -> EvBind
- evBindVar :: EvBind -> EvVar
- isCoEvBindsVar :: EvBindsVar -> Bool
- data EvTerm
  - = EvExpr EvExpr
  - | EvTypeable Type EvTypeable
  - | EvFun {
    - et_tvs :: [TyVar]
    - et_given :: [EvVar]
    - et_binds :: TcEvBinds
    - et_body :: EvVar
    }
- type EvExpr = CoreExpr
- evId :: EvId -> EvExpr
- evCoercion :: TcCoercion -> EvTerm
- evCast :: EvExpr -> TcCoercion -> EvTerm
- evDFunApp :: DFunId -> [Type] -> [EvExpr] -> EvTerm
- evDataConApp :: DataCon -> [Type] -> [EvExpr] -> EvTerm
- evSelector :: Id -> [Type] -> [EvExpr] -> EvExpr
- mkEvCast :: EvExpr -> TcCoercion -> EvTerm
- evVarsOfTerm :: EvTerm -> VarSet
- mkEvScSelectors :: Class -> [TcType] -> [(TcPredType, EvExpr)]
- evTypeable :: Type -> EvTypeable -> EvTerm
- findNeededEvVars :: EvBindMap -> VarSet -> VarSet
- evTermCoercion :: EvTerm -> TcCoercion
- evTermCoercion_maybe :: EvTerm -> Maybe TcCoercion
- data EvCallStack
  - = EvCsEmpty
  - | EvCsPushCall FastString RealSrcSpan EvExpr
- data EvTypeable
  - = EvTypeableTyCon TyCon [EvTerm]
  - | EvTypeableTyApp EvTerm EvTerm
  - | EvTypeableTrFun EvTerm EvTerm EvTerm
  - | EvTypeableTyLit EvTerm
- data HoleExprRef = HER (IORef EvTerm) TcType Unique
- type TcCoercion = Coercion
- type TcCoercionR = CoercionR
- type TcCoercionN = CoercionN
- type TcCoercionP = CoercionP
- data CoercionHole
- type TcMCoercion = MCoercion
- type TcMCoercionN = MCoercionN
- type TcMCoercionR = MCoercionR
- data Role
  - = Nominal
  - | Representational
  - | Phantom
- data LeftOrRight
  - = CLeft
  - | CRight
- pickLR :: LeftOrRight -> (a, a) -> a
- maybeSymCo :: SwapFlag -> TcCoercion -> TcCoercion
- unwrapIP :: Type -> CoercionR
- wrapIP :: Type -> CoercionR
- data QuoteWrapper = QuoteWrapper EvVar Type
- applyQuoteWrapper :: QuoteWrapper -> HsWrapper
- quoteWrapperTyVarTy :: QuoteWrapper -> Type

# HsWrapper

data HsWrapper #

Constructors

WpHole |
WpCompose HsWrapper HsWrapper |
WpFun HsWrapper HsWrapper (Scaled TcTypeFRR) |
WpCast TcCoercionR |
WpEvLam EvVar |
WpEvApp EvTerm |
WpTyLam TyVar |
WpTyApp KindOrType |
WpLet TcEvBinds |
WpMultCoercion Coercion |

#### Instances

Instances details

Monoid HsWrapper # |
Instance details Defined in GHC.Tc.Types.Evidence Methods mempty :: HsWrapper # mappend :: HsWrapper -> HsWrapper -> HsWrapper # mconcat :: [HsWrapper] -> HsWrapper #

Semigroup HsWrapper #

The Semigroup instance is a bit fishy, since `WpCompose`, as a data constructor, is "syntactic" and not associative. Concretely, if `a`, `b`, and `c` aren't `WpHole`:

    (a <> b) <> c ?= a <> (b <> c)

## >

    (a `WpCompose` b) `WpCompose` c /= @ a `WpCompose` (b `WpCompose` c)

However these two associations are are "semantically equal" in the sense that they produce equal functions when passed to `GHC.HsToCore.Binds.dsHsWrapper`.

Instance details Defined in GHC.Tc.Types.Evidence Methods (<>) :: HsWrapper -> HsWrapper -> HsWrapper # sconcat :: NonEmpty HsWrapper -> HsWrapper # stimes :: Integral b => b -> HsWrapper -> HsWrapper #
Data HsWrapper # |

Instance details

Defined in GHC.Tc.Types.Evidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsWrapper -> c HsWrapper #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsWrapper #

toConstr :: HsWrapper -> Constr #

dataTypeOf :: HsWrapper -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HsWrapper) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsWrapper) #

gmapT :: (forall b. Data b => b -> b) -> HsWrapper -> HsWrapper #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsWrapper -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsWrapper -> r #

gmapQ :: (forall d. Data d => d -> u) -> HsWrapper -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> HsWrapper -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsWrapper -> m HsWrapper #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsWrapper -> m HsWrapper #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsWrapper -> m HsWrapper #

Outputable HsWrapper # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: HsWrapper -> SDoc #

(<.>) :: HsWrapper -> HsWrapper -> HsWrapper #

mkWpTyApps :: [Type] -> HsWrapper #

mkWpEvApps :: [EvTerm] -> HsWrapper #

mkWpEvVarApps :: [EvVar] -> HsWrapper #

mkWpTyLams :: [TyVar] -> HsWrapper #

mkWpVisTyLam :: TyVar -> Type -> HsWrapper #

mkWpEvLams :: [Var] -> HsWrapper #

mkWpLet :: TcEvBinds -> HsWrapper #

mkWpFun #

Arguments

:: HsWrapper |
-> HsWrapper |
-> Scaled TcTypeFRR | the "from" type of the first wrapper MUST have a fixed RuntimeRep
-> TcType | Either "from" type or "to" type of the second wrapper (used only when the second wrapper is the identity)
-> HsWrapper |

Smart constructor to create a `WpFun` `HsWrapper`.

PRECONDITION: the "from" type of the first wrapper must have a syntactically fixed RuntimeRep (see Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete).

mkWpCastN :: TcCoercionN -> HsWrapper #

mkWpCastR :: TcCoercionR -> HsWrapper #

mkWpEta :: [Id] -> HsWrapper -> HsWrapper #

collectHsWrapBinders :: HsWrapper -> ([Var], HsWrapper) #

idHsWrapper :: HsWrapper #

isIdHsWrapper :: HsWrapper -> Bool #

pprHsWrapper :: HsWrapper -> (Bool -> SDoc) -> SDoc #

hsWrapDictBinders :: HsWrapper -> Bag DictId #

Identifies the lambda-bound dictionaries of an `HsWrapper`. This is used (only) to allow the pattern-match overlap checker to know what Given dictionaries are in scope.

We specifically do not collect dictionaries bound in a `WpLet`. These are either superclasses of lambda-bound ones, or (extremely numerous) results of binding Wanted dictionaries. We definitely don't want all those cluttering up the Given dictionaries for pattern-match overlap checking!

# Evidence bindings

data TcEvBinds #

Constructors

TcEvBinds EvBindsVar |
EvBinds (Bag EvBind) |

#### Instances

Instances details

Data TcEvBinds # |

Instance details

Defined in GHC.Tc.Types.Evidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TcEvBinds -> c TcEvBinds #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TcEvBinds #

toConstr :: TcEvBinds -> Constr #

dataTypeOf :: TcEvBinds -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TcEvBinds) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TcEvBinds) #

gmapT :: (forall b. Data b => b -> b) -> TcEvBinds -> TcEvBinds #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TcEvBinds -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TcEvBinds -> r #

gmapQ :: (forall d. Data d => d -> u) -> TcEvBinds -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TcEvBinds -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TcEvBinds -> m TcEvBinds #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TcEvBinds -> m TcEvBinds #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TcEvBinds -> m TcEvBinds #

Outputable TcEvBinds # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: TcEvBinds -> SDoc #

data EvBindsVar #

Constructors

EvBindsVar |

Fields

- ebv_uniq :: Unique
- ebv_binds :: IORef EvBindMap
- ebv_tcvs :: IORef CoVarSet

CoEvBindsVar |

Fields

- ebv_uniq :: Unique
- ebv_tcvs :: IORef CoVarSet

#### Instances

Instances details

Uniquable EvBindsVar # |
Instance details Defined in GHC.Tc.Types.Evidence Methods getUnique :: EvBindsVar -> Unique #
Outputable EvBindsVar # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: EvBindsVar -> SDoc #

newtype EvBindMap #

Constructors

EvBindMap |

Fields

- ev_bind_varenv :: DVarEnv EvBind

#### Instances

Instances details

Outputable EvBindMap # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: EvBindMap -> SDoc #

emptyEvBindMap :: EvBindMap #

extendEvBinds :: EvBindMap -> EvBind -> EvBindMap #

lookupEvBind :: EvBindMap -> EvVar -> Maybe EvBind #

evBindMapBinds :: EvBindMap -> Bag EvBind #

foldEvBindMap :: (EvBind -> a -> a) -> a -> EvBindMap -> a #

nonDetStrictFoldEvBindMap :: (EvBind -> a -> a) -> a -> EvBindMap -> a #

filterEvBindMap :: (EvBind -> Bool) -> EvBindMap -> EvBindMap #

isEmptyEvBindMap :: EvBindMap -> Bool #

evBindMapToVarSet :: EvBindMap -> VarSet #

varSetMinusEvBindMap :: VarSet -> EvBindMap -> VarSet #

data EvBindInfo #

Constructors

EvBindGiven |
EvBindWanted |

Fields

- ebi_canonical :: Canonical

data EvBind #

Constructors

EvBind |

Fields

- eb_lhs :: EvVar
- eb_rhs :: EvTerm
- eb_info :: EvBindInfo

#### Instances

Instances details

Outputable EvBind # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: EvBind -> SDoc #

emptyTcEvBinds :: TcEvBinds #

isEmptyTcEvBinds :: TcEvBinds -> Bool #

mkGivenEvBind :: EvVar -> EvTerm -> EvBind #

mkWantedEvBind :: EvVar -> Canonical -> EvTerm -> EvBind #

evBindVar :: EvBind -> EvVar #

isCoEvBindsVar :: EvBindsVar -> Bool #

# EvTerm (already a CoreExpr)

data EvTerm #

Constructors

EvExpr EvExpr |
EvTypeable Type EvTypeable |
EvFun |

Fields

- et_tvs :: [TyVar]
- et_given :: [EvVar]
- et_binds :: TcEvBinds
- et_body :: EvVar

#### Instances

Instances details

Data EvTerm # |

Instance details

Defined in GHC.Tc.Types.Evidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvTerm -> c EvTerm #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvTerm #

toConstr :: EvTerm -> Constr #

dataTypeOf :: EvTerm -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvTerm) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvTerm) #

gmapT :: (forall b. Data b => b -> b) -> EvTerm -> EvTerm #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r #

gmapQ :: (forall d. Data d => d -> u) -> EvTerm -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EvTerm -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm #

Outputable EvTerm # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: EvTerm -> SDoc #

type EvExpr = CoreExpr #

evId :: EvId -> EvExpr #

Any sort of evidence Id, including coercions

evCoercion :: TcCoercion -> EvTerm #

evCast :: EvExpr -> TcCoercion -> EvTerm #

d |> co

evDFunApp :: DFunId -> [Type] -> [EvExpr] -> EvTerm #

evDataConApp :: DataCon -> [Type] -> [EvExpr] -> EvTerm #

evSelector :: Id -> [Type] -> [EvExpr] -> EvExpr #

mkEvCast :: EvExpr -> TcCoercion -> EvTerm #

evVarsOfTerm :: EvTerm -> VarSet #

mkEvScSelectors :: Class -> [TcType] -> [(TcPredType, EvExpr)] #

evTypeable :: Type -> EvTypeable -> EvTerm #

findNeededEvVars :: EvBindMap -> VarSet -> VarSet #

evTermCoercion :: EvTerm -> TcCoercion #

evTermCoercion_maybe :: EvTerm -> Maybe TcCoercion #

data EvCallStack #

Evidence for `CallStack` implicit parameters.

Constructors

EvCsEmpty |
EvCsPushCall FastString RealSrcSpan EvExpr | `EvCsPushCall origin loc stk` represents a call from `origin`, occurring at `loc`, in a calling context `stk`.

#### Instances

Instances details

Data EvCallStack # |

Instance details

Defined in GHC.Tc.Types.Evidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvCallStack -> c EvCallStack #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvCallStack #

toConstr :: EvCallStack -> Constr #

dataTypeOf :: EvCallStack -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvCallStack) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvCallStack) #

gmapT :: (forall b. Data b => b -> b) -> EvCallStack -> EvCallStack #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvCallStack -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvCallStack -> r #

gmapQ :: (forall d. Data d => d -> u) -> EvCallStack -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EvCallStack -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvCallStack -> m EvCallStack #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvCallStack -> m EvCallStack #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvCallStack -> m EvCallStack #

Outputable EvCallStack # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: EvCallStack -> SDoc #

data EvTypeable #

Instructions on how to make a `Typeable` dictionary. See Note [Typeable evidence terms]

Constructors

EvTypeableTyCon TyCon [EvTerm] | Dictionary for `Typeable T` where `T` is a type constructor with all of its kind variables saturated. The `[EvTerm]` is `Typeable` evidence for the applied kinds..
EvTypeableTyApp EvTerm EvTerm | Dictionary for `Typeable (s t)`, given a dictionaries for `s` and `t`.
EvTypeableTrFun EvTerm EvTerm EvTerm | Dictionary for `Typeable (s % w -> t)`, given a dictionaries for `w`, `s`, and `t`.
EvTypeableTyLit EvTerm | Dictionary for a type literal, e.g. `Typeable "foo"` or `Typeable 3` The `EvTerm` is evidence of, e.g., `KnownNat 3` (see #10348)

#### Instances

Instances details

Data EvTypeable # |

Instance details

Defined in GHC.Tc.Types.Evidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvTypeable -> c EvTypeable #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvTypeable #

toConstr :: EvTypeable -> Constr #

dataTypeOf :: EvTypeable -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvTypeable) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvTypeable) #

gmapT :: (forall b. Data b => b -> b) -> EvTypeable -> EvTypeable #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvTypeable -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvTypeable -> r #

gmapQ :: (forall d. Data d => d -> u) -> EvTypeable -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EvTypeable -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvTypeable -> m EvTypeable #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTypeable -> m EvTypeable #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTypeable -> m EvTypeable #

Outputable EvTypeable # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: EvTypeable -> SDoc #

# HoleExprRef

data HoleExprRef #

Where to store evidence for expression holes See Note [Holes] in GHC.Tc.Types.Constraint

Constructors

HER |

Fields

- (IORef EvTerm)

  where to write the erroring expression

- TcType

  expected type of that expression

- Unique

  for debug output only

#### Instances

Instances details

Data HoleExprRef # |

Instance details

Defined in GHC.Tc.Types.Evidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HoleExprRef -> c HoleExprRef #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HoleExprRef #

toConstr :: HoleExprRef -> Constr #

dataTypeOf :: HoleExprRef -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HoleExprRef) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HoleExprRef) #

gmapT :: (forall b. Data b => b -> b) -> HoleExprRef -> HoleExprRef #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HoleExprRef -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HoleExprRef -> r #

gmapQ :: (forall d. Data d => d -> u) -> HoleExprRef -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> HoleExprRef -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HoleExprRef -> m HoleExprRef #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HoleExprRef -> m HoleExprRef #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HoleExprRef -> m HoleExprRef #

Outputable HoleExprRef # |
Instance details Defined in GHC.Tc.Types.Evidence Methods ppr :: HoleExprRef -> SDoc #

# TcCoercion

type TcCoercion = Coercion #

type TcCoercionR = CoercionR #

type TcCoercionN = CoercionN #

type TcCoercionP = CoercionP #

data CoercionHole #

A coercion to be filled in by the type-checker. See Note [Coercion holes]

#### Instances

Instances details

Data CoercionHole # |

Instance details

Defined in GHC.Core.TyCo.Rep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoercionHole -> c CoercionHole #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoercionHole #

toConstr :: CoercionHole -> Constr #

dataTypeOf :: CoercionHole -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoercionHole) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoercionHole) #

gmapT :: (forall b. Data b => b -> b) -> CoercionHole -> CoercionHole #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r #

gmapQ :: (forall d. Data d => d -> u) -> CoercionHole -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CoercionHole -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole #

Uniquable CoercionHole # |
Instance details Defined in GHC.Core.TyCo.Rep Methods getUnique :: CoercionHole -> Unique #
Outputable CoercionHole # |
Instance details Defined in GHC.Core.TyCo.Rep Methods ppr :: CoercionHole -> SDoc #

type TcMCoercion = MCoercion #

type TcMCoercionN = MCoercionN #

type TcMCoercionR = MCoercionR #

data Role #

See Note [Roles] in GHC.Core.Coercion

Order of constructors matters: the Ord instance coincides with the *super*typing relation on roles.

Constructors

Nominal |
Representational |
Phantom |

#### Instances

Instances details

Data Role # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role #

toConstr :: Role -> Constr #

dataTypeOf :: Role -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) #

gmapT :: (forall b. Data b => b -> b) -> Role -> Role #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r #

gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role #

Binary Role # |
Instance details Defined in GHC.Core.Coercion.Axiom Methods put_ :: BinHandle -> Role -> IO () # put :: BinHandle -> Role -> IO (Bin Role) # get :: BinHandle -> IO Role #
Outputable Role # |
Instance details Defined in GHC.Core.Coercion.Axiom Methods ppr :: Role -> SDoc #
Eq Role # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: Role -> Role -> Bool # (/=) :: Role -> Role -> Bool #
Ord Role # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods compare :: Role -> Role -> Ordering # (<) :: Role -> Role -> Bool # (<=) :: Role -> Role -> Bool # (>) :: Role -> Role -> Bool # (>=) :: Role -> Role -> Bool # max :: Role -> Role -> Role # min :: Role -> Role -> Role #
type Anno (Maybe Role) # |
Instance details Defined in GHC.Hs.Decls type Anno (Maybe Role) = EpAnnCO
type Anno (Maybe Role) # |
Instance details Defined in GHC.Hs.Decls type Anno (Maybe Role) = EpAnnCO

data LeftOrRight #

Constructors

CLeft |
CRight |

#### Instances

Instances details

Data LeftOrRight # |

Instance details

Defined in GHC.Types.Basic

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LeftOrRight -> c LeftOrRight #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LeftOrRight #

toConstr :: LeftOrRight -> Constr #

dataTypeOf :: LeftOrRight -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LeftOrRight) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LeftOrRight) #

gmapT :: (forall b. Data b => b -> b) -> LeftOrRight -> LeftOrRight #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r #

gmapQ :: (forall d. Data d => d -> u) -> LeftOrRight -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LeftOrRight -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight #

Binary LeftOrRight # |
Instance details Defined in GHC.Types.Basic Methods put_ :: BinHandle -> LeftOrRight -> IO () # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) # get :: BinHandle -> IO LeftOrRight #
Outputable LeftOrRight # |
Instance details Defined in GHC.Types.Basic Methods ppr :: LeftOrRight -> SDoc #
Eq LeftOrRight # |
Instance details Defined in GHC.Types.Basic Methods (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool #

pickLR :: LeftOrRight -> (a, a) -> a #

maybeSymCo :: SwapFlag -> TcCoercion -> TcCoercion #

If a `SwapFlag` is `IsSwapped`, flip the orientation of a coercion

unwrapIP :: Type -> CoercionR #

Create a `Coercion` that unwraps an implicit-parameter dictionary to expose the underlying value. We expect the `Type` to have the form `IP sym ty`, and return a `Coercion` `co :: IP sym ty ~ ty`

wrapIP :: Type -> CoercionR #

Create a `Coercion` that wraps a value in an implicit-parameter dictionary. See `unwrapIP`.

# QuoteWrapper

data QuoteWrapper #

Constructors

QuoteWrapper EvVar Type |

#### Instances

Instances details

Data QuoteWrapper # |

Instance details

Defined in GHC.Tc.Types.Evidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> QuoteWrapper -> c QuoteWrapper #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c QuoteWrapper #

toConstr :: QuoteWrapper -> Constr #

dataTypeOf :: QuoteWrapper -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c QuoteWrapper) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c QuoteWrapper) #

gmapT :: (forall b. Data b => b -> b) -> QuoteWrapper -> QuoteWrapper #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> QuoteWrapper -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> QuoteWrapper -> r #

gmapQ :: (forall d. Data d => d -> u) -> QuoteWrapper -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> QuoteWrapper -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> QuoteWrapper -> m QuoteWrapper #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> QuoteWrapper -> m QuoteWrapper #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> QuoteWrapper -> m QuoteWrapper #

applyQuoteWrapper :: QuoteWrapper -> HsWrapper #

Convert the QuoteWrapper into a normal HsWrapper which can be used to apply its contents.

quoteWrapperTyVarTy :: QuoteWrapper -> Type #