Deserialization monad.
Methods
endian :: Proxy μ -> EndianDefault byte order of the deserializer.
word8 :: μ Word8Deserialze a byte.
word16 :: μ Word16Deserialize an unsigned 16-bit integer in default byte order.
word32 :: μ Word32Deserialize an unsigned 32-bit integer in default byte order.
word64 :: μ Word64Deserialize an unsigned 64-bit integer in default byte order.
word16L :: μ Word16Deserialize an unsigned 16-bit integer in little endian.
word16B :: μ Word16Deserialize an unsigned 16-bit integer in big endian.
word32L :: μ Word32Deserialize an unsigned 32-bit integer in little endian.
word32B :: μ Word32Deserialize an unsigned 32-bit integer in big endian.
word64L :: μ Word64Deserialize an unsigned 64-bit integer in little endian.
word64B :: μ Word64Deserialize an unsigned 64-bit integer in big endian.
satisfy :: (Word8 -> Bool) -> μ Word8satisfy p deserializes a byte that satisfies the predicate p, failing otherwise.
byte :: Word8 -> μ Word8Deserialize the specified byte value, failing on any other input.
notByte :: Word8 -> μ Word8notByte c deserializes any byte that is not equal to c, failing if c is encountered.
bytes :: ByteString -> μ ByteStringbytes bs deserializes a sequence of bytes given by bs, failing on any other input.
skip :: Int -> μ ()Skip exactly the given number of bytes.
ensure :: Int -> μ ByteStringensure n checks that the input has at least n more bytes and returns a portion of the input of length greater or equal to n (without consuming it).
ensure_ :: Int -> μ ()ensure_ n fails if the input has less than n more bytes.
check :: Int -> μ Booltake :: Int -> μ ByteStringConsume exactly the given number of bytes.
chunk :: μ ByteStringConsume a portion of the input (the size of the returned ByteString is implementation dependent). Empty result means that the eof is reached.
isolate :: Int -> μ α -> μ α
Instances4Deserializer
Deserializer BinaryDeserializerDefined in data-serializer-0.3.5 · Data.DeserializerDeserializer CerealDeserializerDefined in data-serializer-0.3.5 · Data.DeserializerDeserializer μ => Deserializer (BigEndianDeserializer μ)Defined in data-serializer-0.3.5 · Data.DeserializerDeserializer μ => Deserializer (LittleEndianDeserializer μ)Defined in data-serializer-0.3.5 · Data.Deserializer