Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Data.Binary.Shared
Description
Binary serializing with sharing
Synopsis
- class (Typeable alpha, Ord alpha, Eq alpha, Show alpha) => BinaryShared alpha where
- encodeFileSer :: BinaryShared a => FilePath -> a -> IO ()
- encodeSer :: BinaryShared a => a -> ByteString
- decodeSer :: BinaryShared alpha => ByteString -> alpha
Documentation
class (Typeable alpha, Ord alpha, Eq alpha, Show alpha) => BinaryShared alpha where Source #
A class for storing Binary instances with shared nodes. Cycles are not supported, cause put and get is a one path process.
Methods
put :: alpha -> PutShared Source #
Encode a value in the Put monad.
putShared :: (alpha -> PutShared) -> alpha -> PutShared Source #
get :: GetShared alpha Source #
Decode a value in the Get monad
Instances
encodeFileSer :: BinaryShared a => FilePath -> a -> IO () Source #
encodeSer :: BinaryShared a => a -> ByteString Source #
decodeSer :: BinaryShared alpha => ByteString -> alpha Source #