IDynamic is a indexable and serializable version of Dynamic. (See Data.Dynamic
). It is used as containers of objects
in the cache so any new datatype can be incrementally stored without recompilation.
IDimamic provices methods for safe casting, besides serializaton, deserialization, registrations and retrieval by lkey.
data IDynamic= forall a. (Typeable a, IResource a) => IDynamic a deriving Typeable
- data IDynamic = forall a . (Typeable a, IResource a) => IDynamic a
- list :: MVar (Map Word (IDynamic -> IO (Maybe IDynamic), String -> IDynamic, ST IDynamic))
- class DynamicInterface x where
- toIDyn :: x -> IDynamic
- registerType :: IO x
- fromIDyn :: IDynamic -> x
- unsafeFromIDyn :: IDynamic -> x
- safeFromIDyn :: IDynamic -> Maybe x
- data Key = Key TypeRep String
Documentation
class DynamicInterface x whereSource
DynamicInterface groups a set of default method calls to handle dynamic objects. It is not necessary to derive instances from it
:: x | |
-> IDynamic | encapsulates data in a dynamic object |
:: IO x | registers the deserialize, readp and readResource methods for this data type |
:: IDynamic | |
-> x | extract the data from the dynamic object. trows a user error when the cast fails |
:: IDynamic | |
-> x | unsafe version. |
(IResource x, Typeable x) => DynamicInterface x |