streamly-0.8.3: Dataflow programming and declarative concurrency
Copyright(c) 2020 Composewell Technologies
LicenseBSD-3-Clause
Maintainerstreamly@composewell.com
Stabilitypre-release
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.Data.Binary.Decode

Description

Parsers for binary encoded basic Haskell data types.

Synopsis

Documentation

unit :: MonadCatch m => Parser m Word8 () Source #

A value of type () is encoded as 0 in binary encoding.

0 ==> ()

Pre-release

bool :: MonadCatch m => Parser m Word8 Bool Source #

A value of type Bool is encoded as follows in binary encoding.

0 ==> False
1 ==> True

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

word8 :: MonadCatch m => Parser m Word8 Word8 Source #

Accept any byte.

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