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

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Moduleghc-internal-9.1401.0Haskell2010

GHC.Internal.Data.Type.Coercion

Definition of representational equality (Coercion).

  • 1 type
  • 1 class
  • 5 values
datadata Coercion (a :: k) (b :: k) where
#

Representational equality. If Coercion a b is inhabited by some terminating value, then the type a has the same underlying representation as the type b.

To use this equality in practice, pattern-match on the Coercion a b to get out the Coercible a b instance, and then use coerce to apply it.

Constructors

Instances9Category, TestCoercion, Bounded, Enum, Eq, Data, …
  • Category CoercionDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Category
  • TestCoercion (Coercion a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • Coercible a b => Bounded (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • Coercible a b => Enum (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • Eq (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • (Coercible a b, Data a, Data b) => Data (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Ord (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • Coercible a b => Read (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • Show (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
valuerepr :: a :~: b -> Coercion a b
#

Convert propositional (nominal) equality to representational equality

classclass TestCoercion (f :: k -> Type) where
#

This class contains types where you can learn the equality of two types from information contained in terms. Typically, only singleton types should inhabit this class.

Methods

Instances6TestCoercion