Portability | GHC |
---|---|
Maintainer | Simon Meier <iridcode@gmail.com> |
Safe Haskell | None |
Constructing Builder
s using ASCII-based encodings.
- int8Dec :: Int8 -> Builder
- int16Dec :: Int16 -> Builder
- int32Dec :: Int32 -> Builder
- int64Dec :: Int64 -> Builder
- intDec :: Int -> Builder
- integerDec :: Integer -> Builder
- word8Dec :: Word8 -> Builder
- word16Dec :: Word16 -> Builder
- word32Dec :: Word32 -> Builder
- word64Dec :: Word64 -> Builder
- wordDec :: Word -> Builder
- floatDec :: Float -> Builder
- doubleDec :: Double -> Builder
- word8Hex :: Word8 -> Builder
- word16Hex :: Word16 -> Builder
- word32Hex :: Word32 -> Builder
- word64Hex :: Word64 -> Builder
- wordHex :: Word -> Builder
- int8HexFixed :: Int8 -> Builder
- int16HexFixed :: Int16 -> Builder
- int32HexFixed :: Int32 -> Builder
- int64HexFixed :: Int64 -> Builder
- word8HexFixed :: Word8 -> Builder
- word16HexFixed :: Word16 -> Builder
- word32HexFixed :: Word32 -> Builder
- word64HexFixed :: Word64 -> Builder
- floatHexFixed :: Float -> Builder
- doubleHexFixed :: Double -> Builder
- byteStringHexFixed :: ByteString -> Builder
- lazyByteStringHexFixed :: ByteString -> Builder
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"
integerDec :: Integer -> BuilderSource
Currently slow. Decimal encoding of an Integer
using the ASCII digits.
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.