iteratee-0.8.9.4: Iteratee-based I/O

Safe Haskell | None

Data.Iteratee.Binary

Contents

- Types
- Endian multi-byte iteratees
  - bytestring specializations

Description

Monadic Iteratees: incremental input parsers, processors, and transformers

Iteratees for parsing binary data.

Synopsis

- data Endian
  - = MSB
  - | LSB
- endianRead2 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word16
- endianRead3 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word32
- endianRead3i :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Int32
- endianRead4 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word32
- endianRead8 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word64
- readWord16be_bs :: Monad m => Iteratee ByteString m Word16
- readWord16le_bs :: Monad m => Iteratee ByteString m Word16
- readWord32be_bs :: Monad m => Iteratee ByteString m Word32
- readWord32le_bs :: Monad m => Iteratee ByteString m Word32
- readWord64be_bs :: Monad m => Iteratee ByteString m Word64
- readWord64le_bs :: Monad m => Iteratee ByteString m Word64

# Types

data Endian

Indicate endian-ness.

Constructors

MSB | Most Significant Byte is first (big-endian)
LSB | Least Significan Byte is first (little-endian)

Instances

Enum Endian |
Eq Endian |
Ord Endian |
Show Endian |

# Endian multi-byte iteratees

endianRead2 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word16

endianRead3 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word32

endianRead3i :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Int32

Read 3 bytes in an endian manner. If the first bit is set (negative), set the entire first byte so the Int32 will be negative as well.

endianRead4 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word32

endianRead8 :: (Nullable s, ListLike s Word8, Monad m) => Endian -> Iteratee s m Word64

## bytestring specializations

In current versions of `iteratee` there is no difference between the bytestring specializations and polymorphic functions. They exist for compatibility.

readWord16be_bs :: Monad m => Iteratee ByteString m Word16

readWord16le_bs :: Monad m => Iteratee ByteString m Word16

readWord32be_bs :: Monad m => Iteratee ByteString m Word32

readWord32le_bs :: Monad m => Iteratee ByteString m Word32

readWord64be_bs :: Monad m => Iteratee ByteString m Word64

readWord64le_bs :: Monad m => Iteratee ByteString m Word64