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

Copyright(c) 2010 - 2011 Simon Meier
LicenseBSD3-style (see LICENSE)
MaintainerSimon Meier <iridcode@gmail.com>
PortabilityGHC
Safe HaskellNone
LanguageHaskell98

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 -> Builder Source

Decimal encoding of an Int8 using the ASCII digits.

e.g.

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

int16Dec :: Int16 -> Builder Source

Decimal encoding of an Int16 using the ASCII digits.

int32Dec :: Int32 -> Builder Source

Decimal encoding of an Int32 using the ASCII digits.

int64Dec :: Int64 -> Builder Source

Decimal encoding of an Int64 using the ASCII digits.

intDec :: Int -> Builder Source

Decimal encoding of an Int using the ASCII digits.

integerDec :: Integer -> Builder Source

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

word8Dec :: Word8 -> Builder Source

Decimal encoding of a Word8 using the ASCII digits.

word16Dec :: Word16 -> Builder Source

Decimal encoding of a Word16 using the ASCII digits.

word32Dec :: Word32 -> Builder Source

Decimal encoding of a Word32 using the ASCII digits.

word64Dec :: Word64 -> Builder Source

Decimal encoding of a Word64 using the ASCII digits.

wordDec :: Word -> Builder Source

Decimal encoding of a Word using the ASCII digits.

floatDec :: Float -> Builder Source

Currently slow. Decimal encoding of an IEEE Float.

doubleDec :: Double -> Builder Source

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 -> Builder Source

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

word16Hex :: Word16 -> Builder Source

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

word32Hex :: Word32 -> Builder Source

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

word64Hex :: Word64 -> Builder Source

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

wordHex :: Word -> Builder Source

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

Fixed-width hexadecimal numbers

int8HexFixed :: Int8 -> Builder Source

Encode a Int8 using 2 nibbles (hexadecimal digits).

int16HexFixed :: Int16 -> Builder Source

Encode a Int16 using 4 nibbles.

int32HexFixed :: Int32 -> Builder Source

Encode a Int32 using 8 nibbles.

int64HexFixed :: Int64 -> Builder Source

Encode a Int64 using 16 nibbles.

word8HexFixed :: Word8 -> Builder Source

Encode a Word8 using 2 nibbles (hexadecimal digits).

word16HexFixed :: Word16 -> Builder Source

Encode a Word16 using 4 nibbles.

word32HexFixed :: Word32 -> Builder Source

Encode a Word32 using 8 nibbles.

word64HexFixed :: Word64 -> Builder Source

Encode a Word64 using 16 nibbles.

floatHexFixed :: Float -> Builder Source

Encode an IEEE Float using 8 nibbles.

doubleHexFixed :: Double -> Builder Source

Encode an IEEE Double using 16 nibbles.

byteStringHexFixed :: ByteString -> Builder Source

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

lazyByteStringHexFixed :: ByteString -> Builder Source

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