si-bytes-0.1: Byte with type-level units (e.g. B, KB, MB, ...).

si-bytes-0.1: Byte with type-level units (e.g. B, KB, MB, ...).

This package provides types for performing type-safe byte operations (e.g. conversions, addition), taking units into account.

The primary module is Data.Bytes. The module is sufficient for most purposes, providing types that track units (e.g. B, KB, MB, ...) and allow handling of unknown sizes at runtime.

The other module of interest is Data.Bytes.Network. This module has a virtually identical API to Data.Bytes, but the types it provides also track direction (i.e. uploaded vs downloaded), for when this distinction is important (e.g. computing total uploaded network traffic).

Each module is self-contained, so it is expected that users will only need to import one module at a time, unless there is a desire to explicitly use network and non-network byte types in the same module.

Modules