HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulestreamly-core-0.2.2Haskell2010

Streamly.Internal.Data.Binary.Stream

Encode Haskell data types to byte streams.

The primary purpose of this module is to serialize primitive Haskell types to streams for convenient byte by byte processing when such a need arises.

It would be inefficient to use this to build byte streams from algebraic data types. For general serialization of ADTs please use the Serialize type class instances. The fastest way to convert general Haskell types to byte streams is to serialize them to an array and then stream the array.

  • 1 class
  • 24 values

Type class

1 declaration

Encoders

24 declarations
valueword16be :: Monad m => Word16 -> Stream m Word8
#

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

Pre-release

valueword16le :: Monad m => Word16 -> Stream m Word8
#

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

Pre-release

valueword32be :: Monad m => Word32 -> Stream m Word8
#

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

Pre-release

valueword32le :: Monad m => Word32 -> Stream m Word8
#

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

Pre-release

valueword64be :: Monad m => Word64 -> Stream m Word8
#

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

Pre-release

valueword64le :: Monad m => Word64 -> Stream m Word8
#

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

Pre-release

valueint16be :: Monad m => Int16 -> Stream m Word8
#

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

Pre-release

valueint16le :: Monad m => Int16 -> Stream m Word8
#

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

Pre-release

valueint32be :: Monad m => Int32 -> Stream m Word8
#

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

Pre-release

valueint64be :: Monad m => Int64 -> Stream m Word8
#

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

Pre-release

valueint64le :: Monad m => Int64 -> Stream m Word8
#

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

Pre-release