| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Typeable.Compat
- class Typeable a
- typeOf :: Typeable * a => a -> TypeRep
- cast :: (Typeable * a, Typeable * b) => a -> Maybe b
- gcast :: (Typeable k a, Typeable k b) => c a -> Maybe (c b)
- data TypeRep :: *
- showsTypeRep :: TypeRep -> ShowS
- data TyCon :: *
- tyConString :: TyCon -> String
- tyConPackage :: TyCon -> String
- tyConModule :: TyCon -> String
- tyConName :: TyCon -> String
- mkTyCon3 :: String -> String -> String -> TyCon
- mkTyConApp :: TyCon -> [TypeRep] -> TypeRep
- mkAppTy :: TypeRep -> TypeRep -> TypeRep
- mkFunTy :: TypeRep -> TypeRep -> TypeRep
- splitTyConApp :: TypeRep -> (TyCon, [TypeRep])
- funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
- typeRepTyCon :: TypeRep -> TyCon
- typeRepArgs :: TypeRep -> [TypeRep]
- typeRep :: Typeable k a => proxy a -> TypeRep
- data Proxy t :: k -> * = Proxy
Documentation
class Typeable a
The class Typeable allows a concrete representation of a type to
be calculated.
Minimal complete definition
Instances
| Typeable * Bool | |
| Typeable * Char | |
| Typeable * Double | |
| Typeable * Float | |
| Typeable * Int | |
| Typeable * Integer | |
| Typeable * Ordering | |
| Typeable * RealWorld | |
| Typeable * Word | |
| Typeable * Word8 | |
| Typeable * Word16 | |
| Typeable * Word32 | |
| Typeable * Word64 | |
| Typeable * () | |
| Typeable * TypeRep | |
| Typeable * TyCon | |
| (Typeable (k1 -> k) s, Typeable k1 a) => Typeable k (s a) | Kind-polymorphic Typeable instance for type application |
| Typeable ((* -> *) -> Constraint) Alternative | |
| Typeable ((* -> *) -> Constraint) Applicative | |
| Typeable (* -> * -> * -> * -> * -> * -> * -> *) (,,,,,,) | |
| Typeable (* -> * -> * -> * -> * -> * -> *) (,,,,,) | |
| Typeable (* -> * -> * -> * -> * -> *) (,,,,) | |
| Typeable (* -> * -> * -> * -> *) (,,,) | |
| Typeable (* -> * -> * -> *) (,,) | |
| Typeable (* -> * -> * -> *) STArray | |
| Typeable (* -> * -> *) (->) | |
| Typeable (* -> * -> *) Either | |
| Typeable (* -> * -> *) (,) | |
| Typeable (* -> * -> *) Array | |
| Typeable (* -> * -> *) STRef | |
| Typeable (* -> * -> *) ST | |
| Typeable (* -> *) [] | |
| Typeable (* -> *) Ratio | |
| Typeable (* -> *) IO | |
| Typeable (* -> *) Ptr | |
| Typeable (* -> *) FunPtr | |
| Typeable (* -> *) Maybe | |
| Typeable (* -> Constraint) Monoid | |
| Typeable (k -> *) (Proxy k) | |
| Typeable (k -> k -> *) (Coercion k) | |
| Typeable (k -> k -> *) ((:~:) k) |
gcast :: (Typeable k a, Typeable k b) => c a -> Maybe (c b)
A flexible variation parameterised in a type constructor
data TypeRep :: *
A concrete representation of a (monomorphic) type. TypeRep
supports reasonably efficient equality.
showsTypeRep :: TypeRep -> ShowS
data TyCon :: *
tyConString :: TyCon -> String
Observe string encoding of a type representation
tyConPackage :: TyCon -> String
Since: 4.5.0.0
tyConModule :: TyCon -> String
Since: 4.5.0.0
Arguments
| :: String | package name |
| -> String | module name |
| -> String | the name of the type constructor |
| -> TyCon | A unique |
Builds a TyCon object representing a type constructor. An
implementation of Data.Typeable should ensure that the following holds:
A==A' ^ B==B' ^ C==C' ==> mkTyCon A B C == mkTyCon A' B' C'
mkTyConApp :: TyCon -> [TypeRep] -> TypeRep
Applies a type constructor to a sequence of types
mkFunTy :: TypeRep -> TypeRep -> TypeRep
A special case of mkTyConApp, which applies the function
type constructor to a pair of types.
splitTyConApp :: TypeRep -> (TyCon, [TypeRep])
Splits a type constructor application
funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
typeRepTyCon :: TypeRep -> TyCon
Observe the type constructor of a type representation
typeRepArgs :: TypeRep -> [TypeRep]
Observe the argument types of a type representation
typeRep :: Typeable k a => proxy a -> TypeRep
Takes a value of type a and returns a concrete representation
of that type.
Since: 4.7.0.0