An efficient compact, immutable byte string type (both strict and lazy) suitable for binary or 8-bit character data. The ByteString type represents sequences of bytes or 8-bit characters. It is suitable for high performance use, both in terms of large data quantities, or high speed requirements. The ByteString functions follow the same style as Haskell's ordinary lists, so it is easy to convert code from using String to ByteString. Two ByteString variants are provided: Strict ByteStrings keep the string as a single large array. This makes them convenient for passing data between C and Haskell. Lazy ByteStrings use a lazy list of strict chunks which makes it suitable for I/O streaming tasks. The Char8 modules provide a character-based view of the same underlying ByteString types. This makes it convenient to handle mixed binary and 8-bit character content (which is common in many file formats and network protocols). The Builder module provides an efficient way to build up ByteStrings in an ad-hoc way by repeated concatenation. This is ideal for fast serialisation or pretty printing. There is also a ShortByteString type which has a lower memory overhead and can be converted to or from a ByteString. It is suitable for keeping many short strings in memory, especially long-term, without incurring any possible heap fragmentation costs. ByteStrings are not designed for Unicode. For Unicode strings you should use the Text type from the text package. These modules are intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.


Keywords
data, library, Propose Tags, Prelude, Skip to Readme, , Index, Quick Jump, Data.ByteString, Data.ByteString.Builder, Data.ByteString.Builder.Extra, Data.ByteString.Builder.Internal, Data.ByteString.Builder.Prim, Data.ByteString.Builder.Prim.Internal, Data.ByteString.Builder.RealFloat, Data.ByteString.Char8, Data.ByteString.Internal, Data.ByteString.Lazy, Data.ByteString.Lazy.Char8, Data.ByteString.Lazy.Internal, Data.ByteString.Short, Data.ByteString.Short.Internal, Data.ByteString.Unsafe, More info, bytestring-0.12.1.0.tar.gz, browse, Package description, Package maintainers, BenGamari, DonaldStewart, DuncanCoutts, HerbertValerioRiedel, IanLynagh, SylvainHenry, Bodigrim, sjakobi, chessai, clyring, edit package information
License
BSD-3-Clause
Install
cabal install bytestring-0.10.6.0

Documentation

ByteString: Fast, Packed Strings of Bytes

Build Status Hackage Stackage LTS Stackage Nightly

This library provides the Data.ByteString module -- strict and lazy byte arrays manipulable as strings -- providing very time/space-efficient string and IO operations.

For very large data requirements, or constraints on heap size, Data.ByteString.Lazy is provided, a lazy list of bytestring chunks. Efficient processing of multi-gigabyte data can be achieved this way.

The library also provides Data.ByteString.Builder for efficient construction of ByteString values from smaller pieces during binary serialization.

Requirements:

  • Cabal 1.10 or greater
  • GHC 8.0 or greater

Authors

ByteString was derived from the GHC PackedString library, originally written by Bryan O'Sullivan, and then by Simon Marlow. It was adapted and greatly extended for darcs by David Roundy and others. Don Stewart and Duncan Coutts cleaned up and further extended the implementation and added the .Lazy code. Simon Meier contributed the Builder feature.