Module

Data.Typeable

Package
purescript-ajnsit-typeable
Repository
yaitskov/purescript-typeable

#TypeRep Source

data TypeRep :: forall k. k -> Typedata TypeRep a

Indexed TypeReps

Instances

#Typeable Source

class Typeable :: forall k. k -> Constraintclass Typeable a  where

Typeable things have a TypeRep

Members

Instances

#TypeableRecordFields Source

class TypeableRecordFields :: forall k. k -> Constraintclass TypeableRecordFields rowlist  where

A class for records where all fields have Typeable instances, used to implement the Typeable instance for records.

Members

Instances

#TypeRow Source

data TypeRow :: forall k. k -> Typedata TypeRow r

#eqT Source

eqT :: forall a b. TypeRep a -> TypeRep b -> Maybe (a ~ b)

Compare two TypeRep, and potentially return a type witness for equality

#eqTypeRep Source

eqTypeRep :: forall a b. TypeRep a -> TypeRep b -> Boolean

Compare two TypeRep, potentially of differing types, for equality

#cast Source

cast :: forall a b. Typeable a => Typeable b => a -> Maybe b

#gcast Source

gcast :: forall m a b. Typeable a => Typeable b => m a -> Maybe (m b)

#gcast1 Source

gcast1 :: forall s t a c. Typeable (s a) => Typeable (t a) => c (s a) -> Maybe (c (t a))

#gcast2 Source

gcast2 :: forall s t a b c. Typeable (s a b) => Typeable (t a b) => c (s a b) -> Maybe (c (t a b))

#typeRepFromVal Source

typeRepFromVal :: forall a. Typeable a => a -> TypeRep a

Get the TypeRep for a value

#SomeTypeRep Source

data SomeTypeRep

Unindexed typereps Note: Can't use the exists package because it doesn't gel with the polykinded TypeRep

#wrapSomeTypeRep Source

wrapSomeTypeRep :: forall a. TypeRep a -> SomeTypeRep

Wrap a TypeRep into a SomeTypeRep

#unwrapSomeTypeRep Source

unwrapSomeTypeRep :: forall r. SomeTypeRep -> (forall a. TypeRep a -> r) -> r

Extract a TypeRep from a SomeTypeRep

#runSomeTypeRep Source

runSomeTypeRep :: forall r. (forall a. TypeRep a -> r) -> SomeTypeRep -> r

Run a function on a TypeRep from a SomeTypeRep

#eqSomeTypeRep Source

eqSomeTypeRep :: SomeTypeRep -> SomeTypeRep -> Boolean

Compare unindexed typereps

#typeRepFromTag Source

typeRepFromTag :: forall a. Tag a -> TypeRep a

Every Tag can be converted to the corresponding TypeRep

#Tag Source

data Tag :: forall k. k -> Typedata Tag t0

An Opaque Tag type

#makeTag Source

makeTag :: forall t. Unit -> Tag t

This is the only way to create Tags It's a function so that it can never be inlined by the compiler. This function returns unique values that are never equal.

#Tagged Source

class Tagged :: forall k. k -> Constraintclass Tagged a  where

This class should only be used to specify instances for your own datatypes to automatically get Typeable instances It's never necessary to use Tagged as a constraint in order to use Typeable

Members

Instances