base-4.12.0.0: Basic libraries

Copyright(c) The University of Glasgow CWI 2001--2015
LicenseBSD-style (see the file libraries/base/LICENSE)
Safe HaskellSafe
LanguageHaskell2010

Type.Reflection.Unsafe

Contents

Description

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.

Synopsis

Type representations

data TypeRep (a :: k) #

A concrete representation of a (monomorphic) type. TypeRep supports reasonably efficient equality.

Instances
TestEquality (TypeRep :: k -> Type) # 
Instance details

Defined in Data.Typeable.Internal

Methods

testEquality :: TypeRep a -> TypeRep b -> Maybe (a :~: b) #

Eq (TypeRep a) #

Since: base-2.1

Instance details

Defined in Data.Typeable.Internal

Methods

(==) :: TypeRep a -> TypeRep a -> Bool Source #

(/=) :: TypeRep a -> TypeRep a -> Bool Source #

Ord (TypeRep a) #

Since: base-4.4.0.0

Instance details

Defined in Data.Typeable.Internal

Show (TypeRep a) # 
Instance details

Defined in Data.Typeable.Internal

Methods

showsPrec :: Int -> TypeRep a -> ShowS #

show :: TypeRep a -> String #

showList :: [TypeRep a] -> ShowS #

mkTrApp :: forall k1 k2 (a :: k1 -> k2) (b :: k1). TypeRep (a :: k1 -> k2) -> TypeRep (b :: k1) -> TypeRep (a b) #

Construct a representation for a type application.

mkTyCon #

Arguments

:: String

package name

-> String

module name

-> String

the name of the type constructor

-> Int

number of kind variables

-> KindRep

kind representation

-> TyCon

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

Exquisitely unsafe.

typeRepFingerprint :: TypeRep a -> Fingerprint #

Observe the Fingerprint of a type representation

Since: base-4.8.0.0

Kind representations

data KindRep Source #

The representation produced by GHC for conjuring up the kind of a TypeRep. See Note [Representing TyCon kinds: KindRep] in TcTypeable.

Bundled Patterns

pattern KindRepTypeLit :: TypeLitSort -> String -> KindRep 
Instances
Show KindRep # 
Instance details

Defined in GHC.Show

data TypeLitSort Source #

Constructors

TypeLitSymbol 
TypeLitNat 
Instances
Show TypeLitSort #

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Type constructors

data TyCon Source #

Instances
Eq TyCon 
Instance details

Defined in GHC.Classes

Methods

(==) :: TyCon -> TyCon -> Bool Source #

(/=) :: TyCon -> TyCon -> Bool Source #

Ord TyCon 
Instance details

Defined in GHC.Classes

Show TyCon #

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> TyCon -> ShowS #

show :: TyCon -> String #

showList :: [TyCon] -> ShowS #

mkTrCon :: forall k (a :: k). 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.