RefSerialize- Write to and read from ByteStrings maintaining internal memory references

Safe HaskellNone




data ShowF Source


Expr ByteString 
Var Int 


data Error Source


Error String 

data StatW Source


StatW (Context, [ShowF], ByteString) 

data STW a Source


STW (StatW -> (StatW, a)) 


Monad STW

monadic serialization

Functor STW 
Applicative STW 

assocs :: (HashTable h, Hashable a, Ord a) => IOHashTable h a b -> [(a, b)] Source

insert :: (HashTable h, Hashable k, Eq k) => k -> v -> IOHashTable h k v -> IOHashTable h k v Source

delete :: (HashTable h, Hashable k, Eq k) => k -> IOHashTable h k v -> IOHashTable h k v Source

lookup :: (HashTable h, Hashable k, Eq k) => k -> IOHashTable h k v -> Maybe v Source

toList :: (HashTable h, Hashable k, Eq k) => IOHashTable h k v -> [(k, v)] Source

fromList :: (HashTable h, Hashable k, Eq k) => [(k, v)] -> IOHashTable h k v Source

addrHash :: Context -> a -> IO (Either Int Int) Source

return a unique hash identifier for an object the context assures that no StableName used in addrStr is garbage collected, so the hashes are constant and the correspondence address - string remain one to one as long as the context is not garbage collected. Left is returned if it is the first time that addHash is called for that variable

hasht :: a -> (Int, t) Source

varName :: a -> [Char] Source

two variables that point to the same address will have identical varname (derived from import System.Mem.StableName)varName:: a -> String . The stable names of during the serializing deserializing process are not deleted . This is assured by the pointers in the context, so the hash values remain and the comparison of varNames is correct.