HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Tc.Types.Evidence

Contents
  1. HsWrapper
  2. Evidence bindings
  3. EvTerm (already a CoreExpr)
  4. HoleExprRef
  5. TcCoercion
  6. QuoteWrapper
Synopsis

HsWrapper

datadata HsWrapper
#
Instances4Data, Semigroup, Monoid, Outputable
  • Data HsWrapperDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Tc.Types.Evidence
  • Semigroup HsWrapperDefined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · GHC.Tc.Types.Evidence
  • Outputable HsWrapperDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Tc.Types.Evidence
valuemkWpFun
  1. :: HsWrapper
  2. -> HsWrapper
  3. -> Scaled 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: either:

  1. both of the HsWrappers are identities or casts, or

  2. both the "from" and "to" types of the first wrapper have a syntactically fixed RuntimeRep (see Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete).

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

EvTerm (already a CoreExpr)

datadata EvTypeable

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

Constructors

Instances2Data, Outputable

HoleExprRef

TcCoercion

datadata CoercionHole

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

Instances3Data, Uniquable, Outputable
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-lib-parser-9.14.1.20251220 · Language.Haskell.Syntax.Basic
  • Data RoleDefined in ghc-lib-parser-9.14.1.20251220 · Language.Haskell.Syntax.Basic
  • Ord RoleDefined in ghc-lib-parser-9.14.1.20251220 · Language.Haskell.Syntax.Basic
  • NFData RoleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Coercion.Axiom · orphan
  • Outputable RoleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Coercion.Axiom · orphan
  • Binary RoleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Core.Coercion.Axiom · orphan
  • type Anno (Maybe Role) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Decls · orphan
datadata LeftOrRight
#
Instances6Eq, Data, Ord, NFData, Outputable, Binary

QuoteWrapper