-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Fast and simple JSON encoding toolkit
--
-- Minimalistic library for encoding JSON directly to strict bytestring.
--
-- The library focuses on 2 aspects: simplicity and performance. The API
-- consists of just a few functions and achieves performance that is 3
-- times better than that of "aeson" in typical use-cases. In cases where
-- we deal with really large documents (60MB) the performance of "aeson"
-- becomes more comparable.
--
-- For further details please refer to README.
@package jsonifier
@version 0.1
module Jsonifier
-- | Render a JSON value into strict bytestring.
toByteString :: Json -> ByteString
-- | Specification of how to render a JSON value to ByteString. A
-- sort of a JSON-specialized string ByteString builder.
--
-- You can construct it by using the specialized conversion functions
-- from Haskell types. After constructing, you can convert to strict
-- ByteString using the toByteString function.
data Json
-- | JSON Null literal.
null :: Json
-- | JSON Boolean literal.
bool :: Bool -> Json
-- | JSON Number literal from Int.
intNumber :: Int -> Json
-- | JSON Number literal from Word.
wordNumber :: Word -> Json
-- | JSON Number literal from Double.
--
-- Since JSON doesn't have support for them, non-real values like
-- NaN, Infinity, -Infinity get rendered as
-- 0.
doubleNumber :: Double -> Json
-- | JSON Number literal from Scientific.
scientificNumber :: Scientific -> Json
-- | JSON String literal from Text.
textString :: Text -> Json
-- | JSON String literal from Scientific.
--
-- You may need this when the reader of your JSON cannot handle large
-- number literals.
scientificString :: Scientific -> Json
-- | JSON Array literal from a foldable over element literals.
--
-- Don't be afraid to use fmap to map the elements of the input
-- datastructure, it will all be optimized away.
array :: Foldable f => f Json -> Json
-- | JSON Array literal from a foldable over pairs of key to value literal.
--
-- Don't be afraid to use fmap to map the elements of the input
-- datastructure, it will all be optimized away.
object :: Foldable f => f (Text, Json) -> Json