lambdabot-utils-4.1: Utility libraries for the advanced IRC bot, LambdabotSource codeContentsIndex
Lambdabot.Serial
Description
Serialisation
Synopsis
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
data Serial s Source
Constructors
Serial
serialize :: s -> Maybe ByteString
deserialize :: ByteString -> Maybe s
stdSerial :: (Show s, Read s) => Serial sSource
Default `instance' for a 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 as. As for the mapSerializer, its output is line-wise.
mapPackedSerial :: Serial (Map ByteString ByteString)Source
assocListPackedSerial :: Serial [(ByteString, ByteString)]Source
mapListPackedSerial :: Serial (Map ByteString [ByteString])Source
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...
class Packable t whereSource
Methods
readPacked :: ByteString -> tSource
showPacked :: t -> ByteStringSource
show/hide Instances
packedListSerial :: Serial [ByteString]Source
readOnly :: (ByteString -> b) -> Serial bSource
gzip :: ByteString -> ByteStringSource
gunzip :: ByteString -> ByteStringSource
Produced by Haddock version 2.4.2