A wrapper for the new GHC (and Hugs) Dynamic module. The main improvement over the original Dynamic module is that we provide flavours of TypeableXXXX for kinds with arguments other than *, a feature used by DisplayView.
- class Typeable a where
- data TypeRep
- type Dyn = Dynamic
- toDyn :: Typeable a => a -> Dyn
- fromDynamic :: Typeable a => Dyn -> Maybe a
- fromDynamicWE :: Typeable a => Dyn -> WithError a
- coerce :: Typeable a => Dyn -> a
- coerceIO :: Typeable a => Dyn -> IO a
- typeMismatch :: IOError
- dynCast :: (Typeable a, Typeable b) => String -> a -> b
- dynCastOpt :: (Typeable a, Typeable b) => a -> Maybe b
- mkTypeRep :: String -> String -> TypeRep
- class Typeable1_1 ty where
- class Typeable2_11 ty where
- typeOf2_11 :: (Typeable1 typeArg1, Typeable1 typeArg2) => ty typeArg1 typeArg2 -> TypeRep
- class Typeable3_111 ty where
- typeOf3_111 :: (Typeable1 typeArg1, Typeable1 typeArg2, Typeable1 typeArg3) => ty typeArg1 typeArg2 typeArg3 -> TypeRep
- class Typeable4_0111 ty where
- class Typeable5_00111 ty where
- class Typeable6_000111 ty where
Documentation
class Typeable a where
The class Typeable
allows a concrete representation of a type to
be calculated.
data TypeRep
A concrete representation of a (monomorphic) type. TypeRep
supports reasonably efficient equality.
fromDynamic :: Typeable a => Dyn -> Maybe aSource
fromDynamicWE :: Typeable a => Dyn -> WithError aSource
Like fromDynamic
but provides an error message indicating what
types are getting confused.
dynCastOpt :: (Typeable a, Typeable b) => a -> Maybe bSource
mkTypeRep :: String -> String -> TypeRepSource
Construct a TypeRep for a type or type constructor with no arguments. The first string should be the module name, the second that of the type.
class Typeable1_1 ty whereSource
(Typeable2_11 ty, Typeable1 typeArg1) => Typeable1_1 (ty typeArg1) |
class Typeable2_11 ty whereSource
typeOf2_11 :: (Typeable1 typeArg1, Typeable1 typeArg2) => ty typeArg1 typeArg2 -> TypeRepSource
(Typeable3_111 ty, Typeable1 typeArg1) => Typeable2_11 (ty typeArg1) |
class Typeable3_111 ty whereSource
typeOf3_111 :: (Typeable1 typeArg1, Typeable1 typeArg2, Typeable1 typeArg3) => ty typeArg1 typeArg2 typeArg3 -> TypeRepSource
(Typeable4_0111 ty, Typeable ty1) => Typeable3_111 (ty ty1) |
class Typeable4_0111 ty whereSource
typeOf4_0111 :: (Typeable ty1, Typeable1 typeArg1, Typeable1 typeArg2, Typeable1 typeArg3) => ty ty1 typeArg1 typeArg2 typeArg3 -> TypeRepSource
(Typeable5_00111 ty, Typeable ty1) => Typeable4_0111 (ty ty1) |
class Typeable5_00111 ty whereSource
typeOf5_00111 :: (Typeable ty1, Typeable ty2, Typeable1 typeArg1, Typeable1 typeArg2, Typeable1 typeArg3) => ty ty1 ty2 typeArg1 typeArg2 typeArg3 -> TypeRepSource
(Typeable6_000111 ty, Typeable ty1) => Typeable5_00111 (ty ty1) |