HORIZON HASKELLDocslts/ghc-10.0.x04404a62026-10-19Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 04404a6 · 2026-10-19

Modulebase-4.23.0.0Haskell2010

Type.Reflection.Unsafe

The representations of the types TyCon and TypeRep, and the function mkTyCon which is used by derived instances of Typeable to construct TyCons.

Be warned, these functions can be used to construct ill-kinded type representations.

Contents
  1. Type representations
  2. Kind representations
  3. Type constructors
Synopsis
  • Packagebase-4.23.0.0
  • Exports13
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceUnsafe.hs

Type representations

datadata TypeRep (a :: k) where

TypeRep is a concrete representation of a (monomorphic) type. TypeRep supports reasonably efficient equality. See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable

Instances4TestEquality, Eq, Ord, Show
  • TestEquality TypeRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.Internal
  • Eq (TypeRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.Internal
  • Ord (TypeRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.Internal
  • Show (TypeRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.Internal
valuemkTyCon
  1. :: String

    package name

  2. -> String

    module name

  3. -> String

    the name of the type constructor

  4. -> Int

    number of kind variables

  5. -> KindRep

    kind representation

  6. -> TyCon

    A unique TyCon object Used when the strings are dynamically allocated, eg from binary deserialisation

Exquisitely unsafe.

Kind representations

Type constructors

datadata TyCon
#
Instances3Eq, Ord, Show
  • Eq TyConDefined in ghc-internal-10.0.0 · GHC.Internal.Classes
  • Ord TyConDefined in ghc-internal-10.0.0 · GHC.Internal.Classes
  • Show TyConDefined in ghc-internal-10.0.0 · GHC.Internal.Show
valuemkTrCon :: TyCon -> [SomeTypeRep] -> TypeRep a

Construct a representation for a type constructor applied at a monomorphic kind.

Note that this is unsafe as it allows you to construct ill-kinded types.