HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulererebase-1.21.2Haskell2010

Data.Type.Coercion

  • 1 type
  • 1 class
  • 5 values
  • Packagererebase-1.21.2
  • Exports7
  • LanguageHaskell2010
  • LicenceMIT
  • SourceCoercion.hs
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

Instances11Category, Groupoid, Semigroupoid, TestCoercion, Bounded, Enum, …
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
valuerepr :: a :~: b -> Coercion a b
#

Convert propositional (nominal) equality to representational equality