ghc-7.10.2: The GHC API

Safe HaskellNone
LanguageHaskell2010

TcEvidence

Synopsis

Documentation

newtype EvBindMap Source

Constructors

EvBindMap 

data EvBind Source

Constructors

EvBind EvVar EvTerm 

Instances

data EvTypeable Source

Instructions on how to make a Typeable dictionary.

Constructors

EvTypeableTyCon TyCon [Kind]

Dicitionary for concrete type constructors.

EvTypeableTyApp (EvTerm, Type) (EvTerm, Type)

Dictionary for type applications; this is used when we have a type expression starting with a type variable (e.g., Typeable (f a))

EvTypeableTyLit Type

Dictionary for a type literal.

data EvCallStack Source

Evidence for CallStack implicit parameters.

Constructors

EvCsEmpty 
EvCsPushCall Name RealSrcSpan EvTerm

EvCsPushCall name loc stk represents a call to name, occurring at loc, in a calling context stk.

EvCsTop FastString RealSrcSpan EvTerm

EvCsTop name loc stk represents a use of an implicit parameter ?name, occurring at loc, in a calling context stk.

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

maybeTcSubCo :: EqRel -> TcCoercion -> TcCoercion Source

If the EqRel is ReprEq, makes a TcSubCo; otherwise, does nothing. Note that the input coercion should always be nominal.

tcDowngradeRole Source

Arguments

:: Role

desired role

-> Role

current role

-> TcCoercion 
-> TcCoercion 

Change the role of a TcCoercion. Panics if this isn't a downgrade.

mkTcTransAppCo Source

Arguments

:: Role

r1

-> TcCoercion

co1 :: ty1a ~r1 ty1b

-> TcType

ty1a

-> TcType

ty1b

-> Role

r2

-> TcCoercion

co2 :: ty2a ~r2 ty2b

-> TcType

ty2a

-> TcType

ty2b

-> Role

r3

-> TcCoercion

:: ty1a ty2a ~r3 ty1b ty2b

Like mkTcAppCo, but allows the second coercion to be other than nominal. See Note [mkTcTransAppCo]. Role r3 cannot be more stringent than either r1 or r2.

unwrapIP :: Type -> Coercion Source

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`, return a Coercion `co :: IP sym ty ~ ty`.

wrapIP :: Type -> Coercion Source

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