TcEvidence

ghc-8.6.3: The GHC API

Safe Haskell | None
Language | Haskell2010

TcEvidence

Synopsis

- data HsWrapper
  - = WpHole
  - | WpCompose HsWrapper HsWrapper
  - | WpFun HsWrapper HsWrapper TcType SDoc
  - | WpCast TcCoercionR
  - | WpEvLam EvVar
  - | WpEvApp EvTerm
  - | WpTyLam TyVar
  - | WpTyApp KindOrType
  - | WpLet TcEvBinds
- (<.>) :: HsWrapper -> HsWrapper -> HsWrapper
- mkWpTyApps :: [Type] -> HsWrapper
- mkWpEvApps :: [EvTerm] -> HsWrapper
- mkWpEvVarApps :: [EvVar] -> HsWrapper
- mkWpTyLams :: [TyVar] -> HsWrapper
- mkWpLams :: [Var] -> HsWrapper
- mkWpLet :: TcEvBinds -> HsWrapper
- mkWpCastN :: TcCoercionN -> HsWrapper
- mkWpCastR :: TcCoercionR -> HsWrapper
- collectHsWrapBinders :: HsWrapper -> ([Var], HsWrapper)
- mkWpFun :: HsWrapper -> HsWrapper -> TcType -> TcType -> SDoc -> HsWrapper
- mkWpFuns :: [(TcType, HsWrapper)] -> TcType -> HsWrapper -> SDoc -> HsWrapper
- idHsWrapper :: HsWrapper
- isIdHsWrapper :: HsWrapper -> Bool
- pprHsWrapper :: HsWrapper -> (Bool -> SDoc) -> SDoc
- data TcEvBinds
  - = TcEvBinds EvBindsVar
  - | EvBinds (Bag EvBind)
- data EvBindsVar
  - = EvBindsVar {
    - ebv_uniq :: Unique
    - ebv_binds :: IORef EvBindMap
    - ebv_tcvs :: IORef CoVarSet
    }
  - | NoEvBindsVar {
    - 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
- filterEvBindMap :: (EvBind -> Bool) -> EvBindMap -> EvBindMap
- isEmptyEvBindMap :: EvBindMap -> Bool
- data EvBind = EvBind {
  - eb_lhs :: EvVar
  - eb_rhs :: EvTerm
  - eb_is_given :: Bool
  }
- emptyTcEvBinds :: TcEvBinds
- isEmptyTcEvBinds :: TcEvBinds -> Bool
- mkGivenEvBind :: EvVar -> EvTerm -> EvBind
- mkWantedEvBind :: EvVar -> EvTerm -> EvBind
- evBindVar :: EvBind -> EvVar
- isNoEvBindsVar :: 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
- 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 Name RealSrcSpan EvExpr
- data EvTypeable
  - = EvTypeableTyCon TyCon [EvTerm]
  - | EvTypeableTyApp EvTerm EvTerm
  - | EvTypeableTrFun EvTerm EvTerm
  - | EvTypeableTyLit EvTerm
- type TcCoercion = Coercion
- type TcCoercionR = CoercionR
- type TcCoercionN = CoercionN
- type TcCoercionP = CoercionP
- data CoercionHole
- data Role
  - = Nominal
  - | Representational
  - | Phantom
- data LeftOrRight
  - = CLeft
  - | CRight
- pickLR :: LeftOrRight -> (a, a) -> a
- mkTcReflCo :: Role -> TcType -> TcCoercion
- mkTcNomReflCo :: TcType -> TcCoercionN
- mkTcRepReflCo :: TcType -> TcCoercionR
- mkTcTyConAppCo :: Role -> TyCon -> [TcCoercion] -> TcCoercion
- mkTcAppCo :: TcCoercion -> TcCoercionN -> TcCoercion
- mkTcFunCo :: Role -> TcCoercion -> TcCoercion -> TcCoercion
- mkTcAxInstCo :: Role -> CoAxiom br -> BranchIndex -> [TcType] -> [TcCoercion] -> TcCoercion
- mkTcUnbranchedAxInstCo :: CoAxiom Unbranched -> [TcType] -> [TcCoercion] -> TcCoercionR
- mkTcForAllCo :: TyVar -> TcCoercionN -> TcCoercion -> TcCoercion
- mkTcForAllCos :: [(TyVar, TcCoercionN)] -> TcCoercion -> TcCoercion
- mkTcSymCo :: TcCoercion -> TcCoercion
- mkTcTransCo :: TcCoercion -> TcCoercion -> TcCoercion
- mkTcNthCo :: Role -> Int -> TcCoercion -> TcCoercion
- mkTcLRCo :: LeftOrRight -> TcCoercion -> TcCoercion
- mkTcSubCo :: TcCoercionN -> TcCoercionR
- maybeTcSubCo :: EqRel -> TcCoercion -> TcCoercion
- tcDowngradeRole :: Role -> Role -> TcCoercion -> TcCoercion
- mkTcAxiomRuleCo :: CoAxiomRule -> [TcCoercion] -> TcCoercionR
- mkTcCoherenceLeftCo :: TcCoercion -> TcCoercionN -> TcCoercion
- mkTcCoherenceRightCo :: TcCoercion -> TcCoercionN -> TcCoercion
- mkTcPhantomCo :: TcCoercionN -> TcType -> TcType -> TcCoercionP
- mkTcKindCo :: TcCoercion -> TcCoercionN
- tcCoercionKind :: TcCoercion -> Pair TcType
- coVarsOfTcCo :: TcCoercion -> TcTyCoVarSet
- mkTcCoVarCo :: CoVar -> TcCoercion
- isTcReflCo :: TcCoercion -> Bool
- isTcReflexiveCo :: TcCoercion -> Bool
- tcCoercionRole :: TcCoercion -> Role
- unwrapIP :: Type -> CoercionR
- wrapIP :: Type -> CoercionR

# Documentation

data HsWrapper #

Constructors

WpHole |
WpCompose HsWrapper HsWrapper |
WpFun HsWrapper HsWrapper TcType SDoc |
WpCast TcCoercionR |
WpEvLam EvVar |
WpEvApp EvTerm |
WpTyLam TyVar |
WpTyApp KindOrType |
WpLet TcEvBinds |

Instances

Data HsWrapper # |
Instance details Defined in TcEvidence Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsWrapper -> c HsWrapper Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsWrapper Source # toConstr :: HsWrapper -> Constr Source # dataTypeOf :: HsWrapper -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HsWrapper) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsWrapper) Source # gmapT :: (forall b. Data b => b -> b) -> HsWrapper -> HsWrapper Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsWrapper -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsWrapper -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsWrapper -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsWrapper -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsWrapper -> m HsWrapper Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsWrapper -> m HsWrapper Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsWrapper -> m HsWrapper Source #
Outputable HsWrapper # |
Instance details Defined in TcEvidence Methods ppr :: HsWrapper -> SDoc # pprPrec :: Rational -> HsWrapper -> SDoc #

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

mkWpTyApps :: [Type] -> HsWrapper #

mkWpEvApps :: [EvTerm] -> HsWrapper #

mkWpEvVarApps :: [EvVar] -> HsWrapper #

mkWpTyLams :: [TyVar] -> HsWrapper #

mkWpLams :: [Var] -> HsWrapper #

mkWpLet :: TcEvBinds -> HsWrapper #

mkWpCastN :: TcCoercionN -> HsWrapper #

mkWpCastR :: TcCoercionR -> HsWrapper #

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

mkWpFun :: HsWrapper -> HsWrapper -> TcType -> TcType -> SDoc -> HsWrapper #

mkWpFuns :: [(TcType, HsWrapper)] -> TcType -> HsWrapper -> SDoc -> HsWrapper #

`mkWpFuns [(ty1, wrap1), (ty2, wrap2)] ty_res wrap_res`, where `wrap1 :: ty1 "->" ty1'` and `wrap2 :: ty2 "->" ty2'`, `wrap3 :: ty3 "->" ty3'` and `ty_res` is either `ty3` or `ty3'`, gives a wrapper `(ty1' -> ty2' -> ty3) "->" (ty1 -> ty2 -> ty3')`. Notice that the result wrapper goes the other way round to all the others. This is a result of sub-typing contravariance. The SDoc is a description of what you were doing when you called mkWpFuns.

idHsWrapper :: HsWrapper #

isIdHsWrapper :: HsWrapper -> Bool #

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

data TcEvBinds #

Constructors

TcEvBinds EvBindsVar |
EvBinds (Bag EvBind) |

Instances

Data TcEvBinds # |
Instance details Defined in TcEvidence Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TcEvBinds -> c TcEvBinds Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TcEvBinds Source # toConstr :: TcEvBinds -> Constr Source # dataTypeOf :: TcEvBinds -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TcEvBinds) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TcEvBinds) Source # gmapT :: (forall b. Data b => b -> b) -> TcEvBinds -> TcEvBinds Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TcEvBinds -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TcEvBinds -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TcEvBinds -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TcEvBinds -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TcEvBinds -> m TcEvBinds Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TcEvBinds -> m TcEvBinds Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TcEvBinds -> m TcEvBinds Source #
Outputable TcEvBinds # |
Instance details Defined in TcEvidence Methods ppr :: TcEvBinds -> SDoc # pprPrec :: Rational -> TcEvBinds -> SDoc #

data EvBindsVar #

Constructors

EvBindsVar |
Fields ebv_uniq :: Unique ebv_binds :: IORef EvBindMap ebv_tcvs :: IORef CoVarSet
NoEvBindsVar |
Fields ebv_uniq :: Unique ebv_tcvs :: IORef CoVarSet

Instances

Outputable EvBindsVar # |
Instance details Defined in TcEvidence Methods ppr :: EvBindsVar -> SDoc # pprPrec :: Rational -> EvBindsVar -> SDoc #
Uniquable EvBindsVar # |
Instance details Defined in TcEvidence Methods getUnique :: EvBindsVar -> Unique #

newtype EvBindMap #

Constructors

EvBindMap |
Fields ev_bind_varenv :: DVarEnv EvBind

Instances

Outputable EvBindMap # |
Instance details Defined in TcEvidence Methods ppr :: EvBindMap -> SDoc # pprPrec :: Rational -> EvBindMap -> SDoc #

emptyEvBindMap :: EvBindMap #

extendEvBinds :: EvBindMap -> EvBind -> EvBindMap #

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

evBindMapBinds :: EvBindMap -> Bag EvBind #

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

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

isEmptyEvBindMap :: EvBindMap -> Bool #

data EvBind #

Constructors

EvBind |
Fields eb_lhs :: EvVar eb_rhs :: EvTerm eb_is_given :: Bool

Instances

Outputable EvBind # |
Instance details Defined in TcEvidence Methods ppr :: EvBind -> SDoc # pprPrec :: Rational -> EvBind -> SDoc #

emptyTcEvBinds :: TcEvBinds #

isEmptyTcEvBinds :: TcEvBinds -> Bool #

mkGivenEvBind :: EvVar -> EvTerm -> EvBind #

mkWantedEvBind :: EvVar -> EvTerm -> EvBind #

evBindVar :: EvBind -> EvVar #

isNoEvBindsVar :: EvBindsVar -> Bool #

data EvTerm #

Constructors

EvExpr EvExpr |
EvTypeable Type EvTypeable |
EvFun |
Fields et_tvs :: [TyVar] et_given :: [EvVar] et_binds :: TcEvBinds et_body :: EvVar

Instances

Data EvTerm # |
Instance details Defined in TcEvidence Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvTerm -> c EvTerm Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvTerm Source # toConstr :: EvTerm -> Constr Source # dataTypeOf :: EvTerm -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvTerm) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvTerm) Source # gmapT :: (forall b. Data b => b -> b) -> EvTerm -> EvTerm Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r Source # gmapQ :: (forall d. Data d => d -> u) -> EvTerm -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> EvTerm -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm Source #
Outputable EvTerm # |
Instance details Defined in TcEvidence Methods ppr :: EvTerm -> SDoc # pprPrec :: Rational -> 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 #

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 Name RealSrcSpan EvExpr | `EvCsPushCall name loc stk` represents a call to `name`, occurring at `loc`, in a calling context `stk`.

Instances

Data EvCallStack # |
Instance details Defined in TcEvidence Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvCallStack -> c EvCallStack Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvCallStack Source # toConstr :: EvCallStack -> Constr Source # dataTypeOf :: EvCallStack -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvCallStack) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvCallStack) Source # gmapT :: (forall b. Data b => b -> b) -> EvCallStack -> EvCallStack Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvCallStack -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvCallStack -> r Source # gmapQ :: (forall d. Data d => d -> u) -> EvCallStack -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> EvCallStack -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvCallStack -> m EvCallStack Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvCallStack -> m EvCallStack Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvCallStack -> m EvCallStack Source #
Outputable EvCallStack # |
Instance details Defined in TcEvidence Methods ppr :: EvCallStack -> SDoc # pprPrec :: Rational -> 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 | Dictionary for `Typeable (s -> t)`, given a dictionaries for `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 Trac #10348)

Instances

Data EvTypeable # |
Instance details Defined in TcEvidence Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvTypeable -> c EvTypeable Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvTypeable Source # toConstr :: EvTypeable -> Constr Source # dataTypeOf :: EvTypeable -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvTypeable) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvTypeable) Source # gmapT :: (forall b. Data b => b -> b) -> EvTypeable -> EvTypeable Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvTypeable -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvTypeable -> r Source # gmapQ :: (forall d. Data d => d -> u) -> EvTypeable -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> EvTypeable -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvTypeable -> m EvTypeable Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTypeable -> m EvTypeable Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTypeable -> m EvTypeable Source #
Outputable EvTypeable # |
Instance details Defined in TcEvidence Methods ppr :: EvTypeable -> SDoc # pprPrec :: Rational -> EvTypeable -> SDoc #

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

Data CoercionHole # |
Instance details Defined in TyCoRep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoercionHole -> c CoercionHole Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoercionHole Source # toConstr :: CoercionHole -> Constr Source # dataTypeOf :: CoercionHole -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoercionHole) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoercionHole) Source # gmapT :: (forall b. Data b => b -> b) -> CoercionHole -> CoercionHole Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r Source # gmapQ :: (forall d. Data d => d -> u) -> CoercionHole -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> CoercionHole -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole Source #
Outputable CoercionHole # |
Instance details Defined in TyCoRep Methods ppr :: CoercionHole -> SDoc # pprPrec :: Rational -> CoercionHole -> SDoc #

data Role #

Constructors

Nominal |
Representational |
Phantom |

Instances

Eq Role # |
Instance details Defined in CoAxiom Methods (==) :: Role -> Role -> Bool # (/=) :: Role -> Role -> Bool #
Data Role # |
Instance details Defined in CoAxiom Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role Source # toConstr :: Role -> Constr Source # dataTypeOf :: Role -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) Source # gmapT :: (forall b. Data b => b -> b) -> Role -> Role Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role Source #
Ord Role # |
Instance details Defined in CoAxiom 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 #
Outputable Role # |
Instance details Defined in CoAxiom Methods ppr :: Role -> SDoc # pprPrec :: Rational -> Role -> SDoc #
Binary Role # |
Instance details Defined in CoAxiom Methods put_ :: BinHandle -> Role -> IO () # put :: BinHandle -> Role -> IO (Bin Role) # get :: BinHandle -> IO Role #

data LeftOrRight #

Constructors

CLeft |
CRight |

Instances

Eq LeftOrRight # |
Instance details Defined in BasicTypes Methods (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool #
Data LeftOrRight # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LeftOrRight -> c LeftOrRight Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LeftOrRight Source # toConstr :: LeftOrRight -> Constr Source # dataTypeOf :: LeftOrRight -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LeftOrRight) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LeftOrRight) Source # gmapT :: (forall b. Data b => b -> b) -> LeftOrRight -> LeftOrRight Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r Source # gmapQ :: (forall d. Data d => d -> u) -> LeftOrRight -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> LeftOrRight -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source #
Outputable LeftOrRight # |
Instance details Defined in BasicTypes Methods ppr :: LeftOrRight -> SDoc # pprPrec :: Rational -> LeftOrRight -> SDoc #
Binary LeftOrRight # |
Instance details Defined in Binary Methods put_ :: BinHandle -> LeftOrRight -> IO () # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) # get :: BinHandle -> IO LeftOrRight #

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

mkTcReflCo :: Role -> TcType -> TcCoercion #

mkTcNomReflCo :: TcType -> TcCoercionN #

mkTcRepReflCo :: TcType -> TcCoercionR #

mkTcTyConAppCo :: Role -> TyCon -> [TcCoercion] -> TcCoercion #

mkTcAppCo :: TcCoercion -> TcCoercionN -> TcCoercion #

mkTcFunCo :: Role -> TcCoercion -> TcCoercion -> TcCoercion #

mkTcAxInstCo :: Role -> CoAxiom br -> BranchIndex -> [TcType] -> [TcCoercion] -> TcCoercion #

mkTcUnbranchedAxInstCo :: CoAxiom Unbranched -> [TcType] -> [TcCoercion] -> TcCoercionR #

mkTcForAllCo :: TyVar -> TcCoercionN -> TcCoercion -> TcCoercion #

mkTcForAllCos :: [(TyVar, TcCoercionN)] -> TcCoercion -> TcCoercion #

mkTcSymCo :: TcCoercion -> TcCoercion #

mkTcTransCo :: TcCoercion -> TcCoercion -> TcCoercion #

mkTcNthCo :: Role -> Int -> TcCoercion -> TcCoercion #

mkTcLRCo :: LeftOrRight -> TcCoercion -> TcCoercion #

mkTcSubCo :: TcCoercionN -> TcCoercionR #

maybeTcSubCo :: EqRel -> TcCoercion -> TcCoercion #

tcDowngradeRole :: Role -> Role -> TcCoercion -> TcCoercion #

mkTcAxiomRuleCo :: CoAxiomRule -> [TcCoercion] -> TcCoercionR #

mkTcCoherenceLeftCo :: TcCoercion -> TcCoercionN -> TcCoercion #

mkTcCoherenceRightCo :: TcCoercion -> TcCoercionN -> TcCoercion #

mkTcPhantomCo :: TcCoercionN -> TcType -> TcType -> TcCoercionP #

mkTcKindCo :: TcCoercion -> TcCoercionN #

tcCoercionKind :: TcCoercion -> Pair TcType #

coVarsOfTcCo :: TcCoercion -> TcTyCoVarSet #

mkTcCoVarCo :: CoVar -> TcCoercion #

isTcReflCo :: TcCoercion -> Bool #

isTcReflexiveCo :: TcCoercion -> Bool #

This version does a slow check, calculating the related types and seeing if they are equal.

tcCoercionRole :: TcCoercion -> Role #

unwrapIP :: Type -> CoercionR #

Create a `Expr` that unwraps an implicit-parameter or overloaded-label dictionary to expose the underlying value. We expect the `Expr` to have the form `IP sym ty` or `IsLabel sym ty`, and return a `Expr` `co :: IP sym ty ~ ty` or `co :: IsLabel sym ty ~ Proxy# sym -> ty`. See also Note [Type-checking overloaded labels] in TcExpr.

wrapIP :: Type -> CoercionR #

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