open-witness-0.1: open witnesses

Data.OpenWitness.Typeable

Description

This is an approximate re-implementation of Data.Typeable using open witnesses.

Synopsis

Documentation

class Typeable a whereSource

types of kind * with a representation

Methods

rep :: Rep aSource

Instances

(Typeable1 f, Typeable a) => Typeable (f a) 

class Typeable1 t whereSource

types of kind * -> * with a representation

Methods

rep1 :: Rep1 tSource

Instances

(Typeable2 f, Typeable a) => Typeable1 (f a) 

class Typeable2 t whereSource

types of kind * -> * -> * with a representation

Methods

rep2 :: Rep2 tSource

Instances

Typeable2 (->) 

cast :: forall a b. (Typeable a, Typeable b) => a -> Maybe bSource

gcast :: forall a b c. (Typeable a, Typeable b) => c a -> Maybe (c b)Source

type TypeRep = AnyWitness RepSource

represents a type of kind *

typeOf :: forall t. Typeable t => t -> TypeRepSource

type TypeRep1 = AnyWitness1 Rep1Source

represents a type of kind * -> *

typeOf1 :: forall t a. Typeable1 t => t a -> TypeRep1Source

type TypeRep2 = AnyWitness2 Rep2Source

represents a type of kind * -> * -> *

typeOf2 :: forall t a b. Typeable2 t => t a b -> TypeRep2Source

mkFunTy :: TypeRep -> TypeRep -> TypeRepSource

given representations of a and b, make a representation of a -> b

funResultTy :: TypeRep -> TypeRep -> Maybe TypeRepSource

given representations of a -> b and a, make a representation of b (otherwise not)