Data.Bytes.Parser.LittleEndian

bytesmith-0.3.11.1: Nonresumable byte parser

Safe Haskell | None
Language | Haskell2010

Data.Bytes.Parser.LittleEndian

Contents

- One
  - Unsigned
  - Signed
- Many
  - Unsigned
  - Unsigned

Description

Little-endian fixed-width numbers.

Synopsis

- word8 :: e -> Parser e s Word8
- word16 :: e -> Parser e s Word16
- word32 :: e -> Parser e s Word32
- word64 :: e -> Parser e s Word64
- word128 :: e -> Parser e s Word128
- word256 :: e -> Parser e s Word256
- int8 :: e -> Parser e s Int8
- int16 :: e -> Parser e s Int16
- int32 :: e -> Parser e s Int32
- int64 :: e -> Parser e s Int64
- word16Array :: e -> Int -> Parser e s (PrimArray Word16)
- word32Array :: e -> Int -> Parser e s (PrimArray Word32)
- word64Array :: e -> Int -> Parser e s (PrimArray Word64)
- word128Array :: e -> Int -> Parser e s (PrimArray Word128)
- word256Array :: e -> Int -> Parser e s (PrimArray Word256)
- int64Array :: e -> Int -> Parser e s (PrimArray Int64)

# One

## Unsigned

word8 :: e -> Parser e s Word8 #

Unsigned 8-bit word.

word16 :: e -> Parser e s Word16 #

Unsigned 16-bit word.

word32 :: e -> Parser e s Word32 #

Unsigned 32-bit word.

word64 :: e -> Parser e s Word64 #

Unsigned 64-bit word.

word128 :: e -> Parser e s Word128 #

Unsigned 128-bit word.

word256 :: e -> Parser e s Word256 #

Unsigned 256-bit word.

## Signed

int8 :: e -> Parser e s Int8 #

Signed 8-bit integer.

int16 :: e -> Parser e s Int16 #

Signed 16-bit integer.

int32 :: e -> Parser e s Int32 #

Signed 32-bit integer.

int64 :: e -> Parser e s Int64 #

Signed 64-bit integer.

# Many

## Unsigned

word16Array #

Arguments

:: e | Error message if not enough bytes are present
-> Int | Number of little-endian 16-bit words to expect
-> Parser e s (PrimArray Word16) | Native-endian elements

Array of little-endian unsigned 16-bit words. If the host is little-endian, the implementation is optimized to simply `memcpy` bytes into the result array. The result array always has elements in native-endian byte order.

word32Array #

Arguments

:: e | Error message if not enough bytes are present
-> Int | Number of little-endian 32-bit words to consume
-> Parser e s (PrimArray Word32) | Native-endian elements

Parse an array of little-endian unsigned 32-bit words.

word64Array #

Arguments

:: e | Error message if not enough bytes are present
-> Int | Number of little-endian 64-bit words to consume
-> Parser e s (PrimArray Word64) | Native-endian elements

Parse an array of little-endian unsigned 64-bit words.

word128Array #

Arguments

:: e | Error message if not enough bytes are present
-> Int | Number of little-endian 128-bit words to consume
-> Parser e s (PrimArray Word128) | Native-endian elements

Parse an array of little-endian unsigned 128-bit words.

word256Array #

Arguments

:: e | Error message if not enough bytes are present
-> Int | Number of little-endian 256-bit words to consume
-> Parser e s (PrimArray Word256) | Native-endian elements

Parse an array of little-endian unsigned 256-bit words.

## Unsigned

int64Array #

Arguments

:: e | Error message if not enough bytes are present
-> Int | Number of little-endian 64-bit words to expect
-> Parser e s (PrimArray Int64) | Native-endian elements

Parse an array of little-endian signed 64-bit words.