OpenAFP-1.3.2: IBM AFP document format parser and generator

Portability | non-portable (GHC-only)
Stability | experimental
Maintainer | audreyt@audreyt.org
Safe Haskell | None

OpenAFP.Types.Buffer

Description

This module handles sized binary buffers.

Synopsis

- class (Show a, Typeable a) => Buf a where
  - mkBuf :: BS -> a
  - packBuf :: a -> BS
- newtype Buffer0 = Buf0 {
  - fromBuf0 :: BS
  }
- newtype Buffer1 = Buf1 {
  - fromBuf1 :: BS
  }
- newtype Buffer2 = Buf2 {
  - fromBuf2 :: BS
  }

# Documentation

class (Show a, Typeable a) => Buf a where

The Buf class represents buffers, with the leading bytes representing its length.

Methods

mkBuf :: BS -> a

packBuf :: a -> BS

Instances

Buf Buffer2 |
Buf Buffer1 |
Buf Buffer0 |

newtype Buffer0

Buffer0, being a simple BS, is of unlimited length.

Constructors

Buf0 |
Fields fromBuf0 :: BS

Instances

Show Buffer0 |
Typeable Buffer0 |
Storable NStr |
Binary Buffer0 |
Buf Buffer0 |

newtype Buffer1

Buffer1 uses one byte as length, hence is at most 254 bytes long.

Constructors

Buf1 |
Fields fromBuf1 :: BS

Instances

Show Buffer1 |
Typeable Buffer1 |
Binary Buffer1 |
Buf Buffer1 |

newtype Buffer2

Buffer2 uses two bytes; it can store up to 65535 bytes.

Constructors

Buf2 |
Fields fromBuf2 :: BS

Instances

Show Buffer2 |
Typeable Buffer2 |
Binary Buffer2 |
Buf Buffer2 |