Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- writeToByteString :: Write -> ByteString
- data Write = Write {}
- word8 :: Word8 -> Write
- word64AsciiDec :: Word64 -> Write
- wordAsciiDec :: Word -> Write
- int64AsciiDec :: Int64 -> Write
- intAsciiDec :: Int -> Write
- doubleAsciiDec :: Double -> Write
- zeroNonRealDoubleAsciiDec :: Double -> Write
- scientificAsciiDec :: Scientific -> Write
- byteString :: ByteString -> Write
- textUtf8 :: Text -> Write
Documentation
writeToByteString :: Write -> ByteString Source #
Specification of how much bytes to allocate and how to populate them.
Useful for creating strict bytestrings and tasks like that.
word64AsciiDec :: Word64 -> Write Source #
wordAsciiDec :: Word -> Write Source #
int64AsciiDec :: Int64 -> Write Source #
intAsciiDec :: Int -> Write Source #
doubleAsciiDec :: Double -> Write Source #
Render double interpreting non-real values,
such as NaN
, Infinity
, -Infinity
,
as is.
zeroNonRealDoubleAsciiDec :: Double -> Write Source #
Render double interpreting non real values,
such as NaN
, Infinity
, -Infinity
,
as zero.
scientificAsciiDec :: Scientific -> Write Source #
byteString :: ByteString -> Write Source #
textUtf8 :: Text -> Write Source #
Benchmark results in comparison to Data.Text.Encoding.
.decodeUtf8
textUtf8/ptr-poker/latin/1 mean 57.06 ns ( +- 3.283 ns ) textUtf8/ptr-poker/latin/10 mean 214.1 ns ( +- 8.601 ns ) textUtf8/ptr-poker/latin/100 mean 1.536 μs ( +- 75.03 ns ) textUtf8/ptr-poker/greek/1 mean 85.98 ns ( +- 5.038 ns ) textUtf8/ptr-poker/greek/10 mean 482.1 ns ( +- 12.38 ns ) textUtf8/ptr-poker/greek/100 mean 4.398 μs ( +- 33.94 ns ) textUtf8/text/latin/1 mean 60.28 ns ( +- 3.517 ns ) textUtf8/text/latin/10 mean 201.6 ns ( +- 8.118 ns ) textUtf8/text/latin/100 mean 1.323 μs ( +- 51.25 ns ) textUtf8/text/greek/1 mean 99.14 ns ( +- 1.264 ns ) textUtf8/text/greek/10 mean 483.4 ns ( +- 5.844 ns ) textUtf8/text/greek/100 mean 4.238 μs ( +- 40.55 ns )