Copyright | (c) 2020 Composewell Technologies |
---|---|
License | BSD-3-Clause |
Maintainer | streamly@composewell.com |
Stability | pre-release |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Parsers for binary encoded basic Haskell data types.
Synopsis
- unit :: MonadCatch m => Parser m Word8 ()
- bool :: MonadCatch m => Parser m Word8 Bool
- ordering :: MonadCatch m => Parser m Word8 Ordering
- eqWord8 :: MonadCatch m => Word8 -> Parser m Word8 Word8
- word8 :: MonadCatch m => Parser m Word8 Word8
- word16be :: MonadCatch m => Parser m Word8 Word16
- word16le :: MonadCatch m => Parser m Word8 Word16
- word32be :: MonadCatch m => Parser m Word8 Word32
- word32le :: MonadCatch m => Parser m Word8 Word32
- word64be :: MonadCatch m => Parser m Word8 Word64
- word64le :: MonadCatch m => Parser m Word8 Word64
- word64host :: (MonadIO m, MonadCatch m) => Parser m Word8 Word64
Documentation
unit :: MonadCatch m => Parser m Word8 () Source #
A value of type ()
is encoded as 0
in binary encoding.
0 ==> ()
Pre-release
ordering :: MonadCatch m => Parser m Word8 Ordering Source #
A value of type Ordering
is encoded as follows in binary encoding.
0 ==> LT 1 ==> EQ 2 ==> GT
Pre-release
eqWord8 :: MonadCatch m => Word8 -> Parser m Word8 Word8 Source #
Accept the input byte only if it is equal to the specified value.
Pre-release
word16be :: MonadCatch m => Parser m Word8 Word16 Source #
Parse two bytes as a Word16
, the first byte is the MSB of the Word16 and
second byte is the LSB (big endian representation).
Pre-release
word16le :: MonadCatch m => Parser m Word8 Word16 Source #
Parse two bytes as a Word16
, the first byte is the LSB of the Word16 and
second byte is the MSB (little endian representation).
Pre-release
word32be :: MonadCatch m => Parser m Word8 Word32 Source #
Parse four bytes as a Word32
, the first byte is the MSB of the Word32
and last byte is the LSB (big endian representation).
Pre-release
word32le :: MonadCatch m => Parser m Word8 Word32 Source #
Parse four bytes as a Word32
, the first byte is the MSB of the Word32
and last byte is the LSB (big endian representation).
Pre-release
word64be :: MonadCatch m => Parser m Word8 Word64 Source #
Parse eight bytes as a Word64
, the first byte is the MSB of the Word64
and last byte is the LSB (big endian representation).
Pre-release
word64le :: MonadCatch m => Parser m Word8 Word64 Source #
Parse eight bytes as a Word64
, the first byte is the MSB of the Word64
and last byte is the LSB (big endian representation).
Pre-release
word64host :: (MonadIO m, MonadCatch m) => Parser m Word8 Word64 Source #
Parse eight bytes as a Word64
in the host byte order.
Pre-release