This is an approximate re-implementation of Data.Typeable using open witnesses.
- module Data.OpenWitness.Typeable.Rep
- class Typeable a where
- class Typeable1 t where
- class Typeable2 t where
- cast :: forall a b. (Typeable a, Typeable b) => a -> Maybe b
- gcast :: forall a b c. (Typeable a, Typeable b) => c a -> Maybe (c b)
- type TypeRep = AnyWitness Rep
- typeOf :: forall t. Typeable t => t -> TypeRep
- type TypeRep1 = AnyWitness1 Rep1
- typeOf1 :: forall t a. Typeable1 t => t a -> TypeRep1
- type TypeRep2 = AnyWitness2 Rep2
- typeOf2 :: forall t a b. Typeable2 t => t a b -> TypeRep2
- mkFunTy :: TypeRep -> TypeRep -> TypeRep
- funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
- mkAppTy :: TypeRep1 -> TypeRep -> TypeRep
- mkAppTy1 :: TypeRep2 -> TypeRep -> TypeRep1
Documentation
types of kind *
with a representation
types of kind * -> *
with a representation
types of kind * -> * -> *
with a representation
Typeable2 (->) |
type TypeRep = AnyWitness RepSource
represents a type of kind *
type TypeRep1 = AnyWitness1 Rep1Source
represents a type of kind * -> *
type TypeRep2 = AnyWitness2 Rep2Source
represents a type of kind * -> * -> *
mkFunTy :: TypeRep -> TypeRep -> TypeRepSource
given representations of a
and b
, make a representation of a -> b