Safe Haskell | None |
---|---|
Language | Haskell2010 |
Binary serialization of Haskell values
Documentation
class Serializable a where Source #
Binary serializable data
type SizeOf a :: Size Source #
Size of the data in bytes
type Endian a :: Bool Source #
Sensible to endianness
Dynamic size of the data in bytes
The default implementation execute the put method with a PutMonad that only stores the size in bytes. Overload this function if possible!
put :: PutMonad m => Endianness -> a -> m () Source #
Serialize a value
get :: GetMonad m => Endianness -> m a Source #
Deserialize a value
Instances
Serializable Int8 Source # | |
Serializable Int16 Source # | |
Serializable Int32 Source # | |
Serializable Int64 Source # | |
Serializable Word8 Source # | |
Serializable Word16 Source # | |
Serializable Word32 Source # | |
Serializable Word64 Source # | |
Serializable a => Serializable (AsLittleEndian a) Source # | |
Defined in Haskus.Binary.Serialize type SizeOf (AsLittleEndian a) :: Size Source # type Endian (AsLittleEndian a) :: Bool Source # sizeOf :: AsLittleEndian a -> Word Source # put :: PutMonad m => Endianness -> AsLittleEndian a -> m () Source # get :: GetMonad m => Endianness -> m (AsLittleEndian a) Source # | |
Serializable a => Serializable (AsBigEndian a) Source # | |
Defined in Haskus.Binary.Serialize type SizeOf (AsBigEndian a) :: Size Source # type Endian (AsBigEndian a) :: Bool Source # sizeOf :: AsBigEndian a -> Word Source # put :: PutMonad m => Endianness -> AsBigEndian a -> m () Source # get :: GetMonad m => Endianness -> m (AsBigEndian a) Source # |