HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-10.0.0.20260917GHC2024

GHC.Tc.Types.Evidence

  • 25 types
  • 65 values

HsWrapper

23 declarations
datadata HsWrapper
#

HsWrappers are produced by the typechecker to insert pieces of Core syntax.

For example:

  • User writes: id False. Typechecker elaborates to id @Bool False using WpTyApp.

  • User writes: compare True False. Typechecker elaborates to compare $dOrdBool True False using WpEvApp.

A wrapper can be thought of as a function CoreExpr -> CoreExpr which transforms Core syntax by elaboration; we usually write this as expr ↦ wrap[expr]. We often write a wrapper as an "expression with a hole", e.g. WpTyApp Int is hole @Int.

NOTATION ~~>: if wrap[ e::t1 ] :: t2, we write the type of wrap as wrap :: t1 ~~> t2.

Constructors

Instances5Data, Semigroup, Monoid, Outputable, ToHie
  • Data HsWrapperDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.Evidence
  • Semigroup HsWrapperDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.Evidence

    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.

  • Monoid HsWrapperDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.Evidence
  • Outputable HsWrapperDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.Evidence
  • ToHie (LocatedA HsWrapper)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.Ast
valuemkWpFun
  1. :: HsWrapper
  2. -> HsWrapper
  3. -> (SubMultCo, TcTypeFRR)

    the "from" type of the first wrapper

  4. -> TcType

    Either "from" type or "to" type of the second wrapper (used only when the second wrapper is the identity)

  5. -> HsWrapper
#

Smart constructor to create a WpFun HsWrapper, which avoids introducing a lambda abstraction if the two supplied wrappers are either identities or casts.

PRECONDITION: same as Note [WpFun-FRR-INVARIANT]

datadata SubMultCo
#

A sub-multiplicity coercion.

Used only to get multiplicities to line up when typechecking partial applications of data constructors, as per Note [Typechecking data constructors] in GHC.Tc.Gen.Head.

See Note [Multiplicity in deep subsumption]

Constructors

Instances2Data, Outputable

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

27 declarations

EvTerm (already a CoreExpr)

24 declarations
valueevId :: EvId -> EvExpr
#

Any sort of evidence Id, including coercions

datadata EvTypeable
#

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

Constructors

Instances2Data, Outputable

HoleExprRef

1 declaration

TcCoercion

12 declarations
datadata Role
#

See Note [Roles] in GHC.Core.Coercion

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

Instances7Eq, Data, Ord, NFData, Outputable, Binary, …
  • Eq RoleDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Basic
  • Data RoleDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Basic
  • Ord RoleDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Basic
  • NFData RoleDefined in ghc-10.0.0.20260917 · GHC.Core.Coercion.Axiom · orphan
  • Outputable RoleDefined in ghc-10.0.0.20260917 · GHC.Core.Coercion.Axiom · orphan
  • Binary RoleDefined in ghc-10.0.0.20260917 · GHC.Core.Coercion.Axiom · orphan
  • type Anno (Maybe Role) = EpAnnCODefined in ghc-10.0.0.20260917 · GHC.Hs.Decls · orphan

QuoteWrapper

3 declarations