Copyright | (c) Hideyuki Tanaka 2009-2015 (c) Dong Han 2020 |
---|---|
License | BSD3 |
Safe Haskell | None |
Language | Haskell2010 |
Builder
s to encode Haskell data types in MessagePack format.
Synopsis
- value :: Value -> Builder ()
- nil :: Builder ()
- bool :: Bool -> Builder ()
- int :: Int64 -> Builder ()
- float :: Float -> Builder ()
- double :: Double -> Builder ()
- scientificValue :: Integer -> Int64 -> Value
- scientific :: Integer -> Int64 -> Builder ()
- timestampValue :: Int64 -> Int32 -> Value
- timestamp :: Int64 -> Int32 -> Builder ()
- str' :: String -> Builder ()
- str :: Text -> Builder ()
- bin :: Bytes -> Builder ()
- array :: Vec v a => (a -> Builder ()) -> v a -> Builder ()
- array' :: (a -> Builder ()) -> [a] -> Builder ()
- arrayHeader :: Int -> Builder ()
- map :: (a -> Builder ()) -> (b -> Builder ()) -> Vector (a, b) -> Builder ()
- map' :: (a -> Builder ()) -> (b -> Builder ()) -> [(a, b)] -> Builder ()
- mapHeader :: Int -> Builder ()
- ext :: Word8 -> Bytes -> Builder ()
Documentation
scientificValue :: Integer -> Int64 -> Value Source #
Construct a scientific value, see scientific
.
scientific :: Integer -> Int64 -> Builder () Source #
Write a scientific value in ext 0x00(positive) and 0x01(negative) format, e.g.
0xD5 | 0x00 | 0x00 | 0x00 |
0xC7 | XXXXXXXX | 0x00 | base10 exponent(MessagePack int format) | coefficient(big endian 256-base limbs |
timestampValue :: Int64 -> Int32 -> Value Source #
Construct a timestamp(seconds, nanoseconds) value.
timestamp :: Int64 -> Int32 -> Builder () Source #
Write a timestamp(seconds, nanoseconds) in ext 0xFF format, e.g.
arrayHeader :: Int -> Builder () Source #