bytestring-0.10.0.2: Fast, compact, strict and lazy byte strings with a list interface

PortabilityGHC
MaintainerSimon Meier <iridcode@gmail.com>
Safe HaskellNone

Data.ByteString.Lazy.Builder.ASCII

Contents

Description

Constructing Builders using ASCII-based encodings.

Synopsis

Decimal numbers

Decimal encoding of numbers using ASCII encoded characters.

int8Dec :: Int8 -> BuilderSource

Decimal encoding of an Int8 using the ASCII digits.

e.g.

 toLazyByteString (int8Dec 42)   = "42"
 toLazyByteString (int8Dec (-1)) = "-1"

int16Dec :: Int16 -> BuilderSource

Decimal encoding of an Int16 using the ASCII digits.

int32Dec :: Int32 -> BuilderSource

Decimal encoding of an Int32 using the ASCII digits.

int64Dec :: Int64 -> BuilderSource

Decimal encoding of an Int64 using the ASCII digits.

intDec :: Int -> BuilderSource

Decimal encoding of an Int using the ASCII digits.

integerDec :: Integer -> BuilderSource

Currently slow. Decimal encoding of an Integer using the ASCII digits.

word8Dec :: Word8 -> BuilderSource

Decimal encoding of a Word8 using the ASCII digits.

word16Dec :: Word16 -> BuilderSource

Decimal encoding of a Word16 using the ASCII digits.

word32Dec :: Word32 -> BuilderSource

Decimal encoding of a Word32 using the ASCII digits.

word64Dec :: Word64 -> BuilderSource

Decimal encoding of a Word64 using the ASCII digits.

wordDec :: Word -> BuilderSource

Decimal encoding of a Word using the ASCII digits.

floatDec :: Float -> BuilderSource

Currently slow. Decimal encoding of an IEEE Float.

doubleDec :: Double -> BuilderSource

Currently slow. Decimal encoding of an IEEE Double.

Hexadecimal numbers

Encoding positive integers as hexadecimal numbers using lower-case ASCII characters. The shortest possible representation is used. For example,

>>> toLazyByteString (word16Hex 0x0a10)
Chunk "a10" Empty

Note that there is no support for using upper-case characters. Please contact the maintainer, if your application cannot work without hexadecimal encodings that use upper-case characters.

word8Hex :: Word8 -> BuilderSource

Shortest hexadecimal encoding of a Word8 using lower-case characters.

word16Hex :: Word16 -> BuilderSource

Shortest hexadecimal encoding of a Word16 using lower-case characters.

word32Hex :: Word32 -> BuilderSource

Shortest hexadecimal encoding of a Word32 using lower-case characters.

word64Hex :: Word64 -> BuilderSource

Shortest hexadecimal encoding of a Word64 using lower-case characters.

wordHex :: Word -> BuilderSource

Shortest hexadecimal encoding of a Word using lower-case characters.

Fixed-width hexadecimal numbers

int8HexFixed :: Int8 -> BuilderSource

Encode a Int8 using 2 nibbles (hexadecimal digits).

int16HexFixed :: Int16 -> BuilderSource

Encode a Int16 using 4 nibbles.

int32HexFixed :: Int32 -> BuilderSource

Encode a Int32 using 8 nibbles.

int64HexFixed :: Int64 -> BuilderSource

Encode a Int64 using 16 nibbles.

word8HexFixed :: Word8 -> BuilderSource

Encode a Word8 using 2 nibbles (hexadecimal digits).

word16HexFixed :: Word16 -> BuilderSource

Encode a Word16 using 4 nibbles.

word32HexFixed :: Word32 -> BuilderSource

Encode a Word32 using 8 nibbles.

word64HexFixed :: Word64 -> BuilderSource

Encode a Word64 using 16 nibbles.

floatHexFixed :: Float -> BuilderSource

Encode an IEEE Float using 8 nibbles.

doubleHexFixed :: Double -> BuilderSource

Encode an IEEE Double using 16 nibbles.

byteStringHexFixed :: ByteString -> BuilderSource

Encode each byte of a ByteString using its fixed-width hex encoding.

lazyByteStringHexFixed :: ByteString -> BuilderSource

Encode each byte of a lazy ByteString using its fixed-width hex encoding.