Safe Haskell | None |
---|---|
Language | Haskell2010 |
DSL for construction of JSON.
Synopsis
- data Literal
- null :: Literal
- boolean :: Bool -> Literal
- numberFromInt :: Int -> Literal
- numberFromInteger :: Integer -> Literal
- numberFromDouble :: Double -> Literal
- numberFromScientific :: Scientific -> Literal
- stringFromText :: Text -> Literal
- stringFromLazyText :: Text -> Literal
- stringFromBytes :: ByteString -> Literal
- stringFromLazyBytes :: ByteString -> Literal
- object :: Rows -> Literal
- objectFromRows :: [Rows] -> Literal
- array :: Elements -> Literal
- arrayFromLiterals :: [Literal] -> Literal
- data Rows
- row :: Text -> Literal -> Rows
- data Elements
- element :: Literal -> Elements
Literal builders
numberFromScientific :: Scientific -> Literal Source #
JSON Number literal from Scientific
.
stringFromLazyText :: Text -> Literal Source #
JSON String literal from lazy Text encoded using UTF8.
stringFromBytes :: ByteString -> Literal Source #
JSON String literal from ByteString
with only escaping applied to it.
stringFromLazyBytes :: ByteString -> Literal Source #
JSON String literal from lazy ByteString with only escaping applied to it.
objectFromRows :: [Rows] -> Literal Source #
JSON Object literal from a list of rows.
A convienience shortcut to object . mconcat
for typical cases.
arrayFromLiterals :: [Literal] -> Literal Source #
JSON Array literal from a list of element literals.
A convienience shortcut to array . foldMap element
for typical cases.