Safe Haskell | None |
---|
Serialisation
- data Serial s = Serial {
- serialize :: s -> Maybe ByteString
- deserialize :: ByteString -> Maybe s
- stdSerial :: (Show s, Read s) => Serial s
- mapSerial :: (Ord k, Show k, Show v, Read k, Read v) => Serial (Map k v)
- listSerial :: (Read a, Show a) => Serial [a]
- mapPackedSerial :: Serial (Map ByteString ByteString)
- assocListPackedSerial :: Serial [(ByteString, ByteString)]
- mapListPackedSerial :: Serial (Map ByteString [ByteString])
- readM :: (Monad m, Read a) => String -> m a
- class Packable t where
- readPacked :: ByteString -> t
- showPacked :: t -> ByteString
- packedListSerial :: Serial [ByteString]
- readOnly :: (ByteString -> b) -> Serial b
- gzip :: ByteString -> ByteString
- gunzip :: ByteString -> ByteString
Documentation
Serial | |
|
mapSerial :: (Ord k, Show k, Show v, Read k, Read v) => Serial (Map k v)Source
Serializes a Map
type if both the key and the value are instances
of Read and Show. The serialization is done by converting the map to
and from lists. Results are saved line-wise, for better editing and
revison control.
listSerial :: (Read a, Show a) => Serial [a]Source
Serialize a list of a
s. As for the mapSerializer
, its output is line-wise.
readM :: (Monad m, Read a) => String -> m aSource
readM
behaves like read, but catches failure in a monad.
this allocates a 20-30 M on startup...
readPacked :: ByteString -> tSource
showPacked :: t -> ByteStringSource
Packable [(ByteString, ByteString)] | |
Packable (Map ByteString [ByteString]) | An instance for Map Packed [Packed] uses gzip compression |
Packable (Map ByteString (Bool, [(String, Int)])) | |
Packable (Map ByteString ByteString) |
readOnly :: (ByteString -> b) -> Serial bSource
gzip :: ByteString -> ByteStringSource
gunzip :: ByteString -> ByteStringSource