vcache-0.2.3: large, persistent, memcached values and structure sharing for Haskell

Safe HaskellNone




class Typeable a => VCacheable a where Source

To be utilized with VCache, a value must be serializable as a simple sequence of binary data and child VRefs. Also, to put then get a value must result in equivalent values. Further, values are Typeable to support memory caching of values loaded.

Under the hood, structured data is serialized as the pair:

(ByteString,[Either VRef PVar])

Developers must ensure that get on the serialization from put returns the same value. And get must be backwards compatible. Developers should consider version wrappers, cf. SafeCopy package.


put :: a -> VPut () Source

Serialize a value as a stream of bytes and value references.

get :: VGet a Source

Parse a value from its serialized representation into memory.