open-witness-0.4: open witnesses

Safe HaskellNone
LanguageHaskell2010

Data.OpenWitness.Typeable

Description

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

Synopsis

Documentation

class Typeable a where #

types of kind * with a representation

Minimal complete definition

typeRep

Methods

typeRep :: TypeRep a #

Instances

(Typeable (k1 -> k2) f, Typeable k1 a) => Typeable k2 (f a) # 

Methods

typeRep :: TypeRep (f a) a #

Typeable * Bool # 

Methods

typeRep :: TypeRep Bool a #

Typeable * Char # 

Methods

typeRep :: TypeRep Char a #

Typeable * Int # 

Methods

typeRep :: TypeRep Int a #

Typeable * Type # 

Methods

typeRep :: TypeRep Type a #

Typeable * Constraint # 
Typeable * () # 

Methods

typeRep :: TypeRep () a #

Typeable (* -> * -> *) (->) # 

Methods

typeRep :: TypeRep (->) a #

Typeable (* -> * -> *) Either # 

Methods

typeRep :: TypeRep Either a #

Typeable (* -> * -> *) (,) # 

Methods

typeRep :: TypeRep (,) a #

Typeable (* -> *) [] # 

Methods

typeRep :: TypeRep [] a #

Typeable (* -> *) Maybe # 

Methods

typeRep :: TypeRep Maybe a #

Typeable (k -> Constraint) (Typeable k) # 

Methods

typeRep :: TypeRep (Typeable k) a #

Typeable (k -> *) (TypeRep k) # 

Methods

typeRep :: TypeRep (TypeRep k) a #

type Fun = (->) #

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

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

mkFunTy :: TypeRep a -> TypeRep b -> TypeRep (a -> b) #

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

funResultTy :: TypeRep (a -> b) -> TypeRep a -> Maybe (TypeRep b) #

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

mkAppTy :: forall k1 k2 f a. TypeRep f -> TypeRep a -> TypeRep (f a) #