HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulestreamly-core-0.2.2Haskell2010

Streamly.Internal.Data.Binary.Parser

Decode Haskell data types from byte streams.

It would be inefficient to use this to compose parsers for general algebraic data types. For general deserialization of ADTs please use the Serialize type class instances. The fastest way to deserialize byte streams representing Haskell data types is to write them to arrays and deserialize the array using the Serialize type class.

  • 1 class
  • 24 values

Type class

1 declaration

Decoders

24 declarations
valueunit :: Monad m => Parser Word8 m ()
#

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

0 ==> ()

Pre-release

valuebool :: Monad m => Parser Word8 m Bool
#

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

0 ==> False
1 ==> True

Pre-release

valueword16be :: Monad m => Parser Word8 m Word16
#

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

valueword16le :: Monad m => Parser Word8 m Word16
#

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

valueword32be :: Monad m => Parser Word8 m Word32
#

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

valueword32le :: Monad m => Parser Word8 m Word32
#

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

valueword64be :: Monad m => Parser Word8 m Word64
#

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

valueword64le :: Monad m => Parser Word8 m Word64
#

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

valueint16be :: Monad m => Parser Word8 m Int16
#

Parse two bytes as a Int16, the first byte is the MSB of the Int16 and second byte is the LSB (big endian representation).

Pre-release

valueint16le :: Monad m => Parser Word8 m Int16
#

Parse two bytes as a Int16, the first byte is the LSB of the Int16 and second byte is the MSB (little endian representation).

Pre-release

valueint32be :: Monad m => Parser Word8 m Int32
#

Parse four bytes as a Int32, the first byte is the MSB of the Int32 and last byte is the LSB (big endian representation).

Pre-release

valueint32le :: Monad m => Parser Word8 m Int32
#

Parse four bytes as a Int32, the first byte is the MSB of the Int32 and last byte is the LSB (big endian representation).

Pre-release

valueint64be :: Monad m => Parser Word8 m Int64
#

Parse eight bytes as a Int64, the first byte is the MSB of the Int64 and last byte is the LSB (big endian representation).

Pre-release

valueint64le :: Monad m => Parser Word8 m Int64
#

Parse eight bytes as a Int64, the first byte is the MSB of the Int64 and last byte is the LSB (big endian representation).

Pre-release