 | TCache-0.6.4: A Transactional data cache with configurable persistence | Contents | Index |
|
|
|
Description |
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 |
|
Synopsis |
|
|
|
Documentation |
|
data IDynamic |
Constructors | | Instances | |
|
|
list :: MVar (Map Word (IDynamic -> IO (Maybe IDynamic), String -> IDynamic, ST IDynamic)) |
|
class DynamicInterface x where |
DynamicInterface groups a set of default method calls to handle dynamic objects. It is not necessary to derive instances from it
| | Methods | toIDyn | :: x | | -> IDynamic | encapsulates data in a dynamic object
|
| | registerType | :: IO x | registers the deserialize, readp and readResource methods for this data type
|
| | fromIDyn | :: IDynamic | | -> x | extract the data from the dynamic object. trows a user error when the cast fails
|
| | unsafeFromIDyn | | | safeFromIDyn | |
|
|
|
data Key |
Key datatype can be used to read any object trough the Dynamic interface.
data Key = Key TypeRep String deriving Typeable Example
mst <- getDResource $ Key type keyofDesiredObject
case mst of
Nothing -> error $ "not found "++ key
Just (idyn) -> fromIDyn idyn :: DesiredDatatype} | Constructors | | Instances | |
|
|
Produced by Haddock version 2.4.2 |