planet-mitchell-0.0.0: Planet Mitchell

Safe HaskellSafe
LanguageHaskell2010

Typeable

Contents

Synopsis

Documentation

class Typeable (a :: k) #

The class Typeable allows a concrete representation of a type to be calculated.

Minimal complete definition

typeRep#

cast :: (Typeable a, Typeable b) => a -> Maybe b #

The type-safe cast operation

eqT :: (Typeable a, Typeable b) => Maybe (a :~: b) #

Extract a witness of equality of two types

Since: base-4.7.0.0

gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b) #

A flexible variation parameterised in a type constructor

gcast1 :: (Typeable t, Typeable t') => c (t a) -> Maybe (c (t' a)) #

Cast over k1 -> k2

gcast2 :: (Typeable t, Typeable t') => c (t a b) -> Maybe (c (t' a b)) #

Cast over k1 -> k2 -> k3

data TypeRep (a :: k) :: forall k. k -> * #

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

Instances
TestEquality (TypeRep :: k -> *) 
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 #

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

Ord (TypeRep a)

Since: base-4.4.0.0

Instance details

Defined in Data.Typeable.Internal

Methods

compare :: TypeRep a -> TypeRep a -> Ordering #

(<) :: TypeRep a -> TypeRep a -> Bool #

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

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

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

max :: TypeRep a -> TypeRep a -> TypeRep a #

min :: TypeRep a -> TypeRep a -> TypeRep a #

Show (TypeRep a) 
Instance details

Defined in Data.Typeable.Internal

Methods

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

show :: TypeRep a -> String #

showList :: [TypeRep a] -> ShowS #

Hashable (TypeRep a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> TypeRep a -> Int #

hash :: TypeRep a -> Int #

Typeable a => Serialise (TypeRep a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

typeOf :: Typeable a => a -> TypeRep a #

withTypeable :: TypeRep a -> (Typeable a -> r) -> r #

Use a TypeRep as Typeable evidence.

pattern App :: forall k2 (t :: k2). () => forall k1 (a :: k1 -> k2) (b :: k1). t ~ a b => TypeRep a -> TypeRep b -> TypeRep t #

A type application.

For instance,

typeRep @(Maybe Int) === App (typeRep @Maybe) (typeRep @Int)

Note that this will also match a function type,

typeRep @(Int# -> Char)
  ===
App (App arrow (typeRep @Int#)) (typeRep @Char)

where arrow :: TypeRep ((->) :: TYPE IntRep -> Type -> Type).

pattern Con :: forall k (a :: k). () => IsApplication a ~ "" => TyCon -> TypeRep a #

Pattern match on a type constructor

pattern Con' :: forall k (a :: k). () => IsApplication a ~ "" => TyCon -> [SomeTypeRep] -> TypeRep a #

Pattern match on a type constructor including its instantiated kind variables.

For instance,

App (Con' proxyTyCon ks) intRep = typeRep @(Proxy @Int)

will bring into scope,

proxyTyCon :: TyCon
ks         == [someTypeRep Type] :: [SomeTypeRep]
intRep     == typeRep Int

pattern Fun :: forall k (fun :: k). () => forall (r1 :: RuntimeRep) (r2 :: RuntimeRep) (arg :: TYPE r1) (res :: TYPE r2). (k ~ Type, fun ~~ (arg -> res)) => TypeRep arg -> TypeRep res -> TypeRep fun #

The function type constructor.

For instance,

typeRep @(Int -> Char) === Fun (typeRep @Int) (typeRep @Char)

typeRepTyCon :: TypeRep a -> TyCon #

Observe the type constructor of a type representation

rnfTypeRep :: TypeRep a -> () #

Helper to fully evaluate TypeRep for use as NFData(rnf) implementation

Since: base-4.8.0.0

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

Type equality

Since: base-4.10

typeRepKind :: TypeRep a -> TypeRep k #

Observe the kind of a type.

data SomeTypeRep where #

A non-indexed type representation.

Constructors

SomeTypeRep :: SomeTypeRep 
Instances
Eq SomeTypeRep 
Instance details

Defined in Data.Typeable.Internal

Ord SomeTypeRep 
Instance details

Defined in Data.Typeable.Internal

Show SomeTypeRep

Since: base-4.10.0.0

Instance details

Defined in Data.Typeable.Internal

Hashable SomeTypeRep 
Instance details

Defined in Data.Hashable.Class

NFData TypeRep

NOTE: Only defined for base-4.8.0.0 and later

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: TypeRep -> () #

Serialise SomeTypeRep

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

someTypeRep :: Typeable a => proxy a -> SomeTypeRep #

Takes a value of type a and returns a concrete representation of that type.

Since: base-4.7.0.0

someTypeRepTyCon :: SomeTypeRep -> TyCon #

Observe the type constructor of a quantified type representation.

rnfSomeTypeRep :: SomeTypeRep -> () #

Helper to fully evaluate SomeTypeRep for use as NFData(rnf) implementation

Since: base-4.10.0.0

data TyCon #

Instances
Eq TyCon 
Instance details

Defined in GHC.Classes

Methods

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

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

Ord TyCon 
Instance details

Defined in GHC.Classes

Methods

compare :: TyCon -> TyCon -> Ordering #

(<) :: TyCon -> TyCon -> Bool #

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

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

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

max :: TyCon -> TyCon -> TyCon #

min :: TyCon -> TyCon -> TyCon #

Show TyCon

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> TyCon -> ShowS #

show :: TyCon -> String #

showList :: [TyCon] -> ShowS #

NFData TyCon

NOTE: Only defined for base-4.8.0.0 and later

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: TyCon -> () #

Serialise TyCon

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

rnfTyCon :: TyCon -> () #

data Module #

Instances
Eq Module 
Instance details

Defined in GHC.Classes

Methods

(==) :: Module -> Module -> Bool #

(/=) :: Module -> Module -> Bool #

Show Module

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

rnfModule :: Module -> () #

Helper to fully evaluate TyCon for use as NFData(rnf) implementation

Since: base-4.8.0.0

Optics

_cast :: (Typeable s, Typeable a) => Traversal' s a #

A Traversal' for working with a cast of a Typeable value.

_gcast :: (Typeable s, Typeable a) => Traversal' (c s) (c a) #

A Traversal' for working with a gcast of a Typeable value.