Distribution.Utils.Json

Cabal-3.11.0.0: A framework for packaging Haskell software

Safe Haskell | Safe-Inferred
Language | Haskell2010

Distribution.Utils.Json

Description

Extremely simple JSON helper. Don't do anything too fancy with this!

Synopsis

- data Json
  - = JsonArray [Json]
  - | JsonBool !Bool
  - | JsonNull
  - | JsonNumber !Int
  - | JsonObject [(String, Json)]
  - | JsonString !String
- (.=) :: String -> Json -> (String, Json)
- renderJson :: Json -> ByteString

# Documentation

data Json Source #

Constructors

JsonArray [Json] |
JsonBool !Bool |
JsonNull |
JsonNumber !Int |
JsonObject [(String, Json)] |
JsonString !String |

#### Instances

Instances details

Show Json Source # |
Instance details Defined in Distribution.Utils.Json Methods showsPrec :: Int -> Json -> ShowS # show :: Json -> String # showList :: [Json] -> ShowS #

(.=) :: String -> Json -> (String, Json) Source #

A shorthand for building up `JsonObject`s >>> JsonObject [ "a" .= JsonNumber 42, "b" .= JsonBool True ] JsonObject [("a",JsonNumber 42),("b",JsonBool True)]

renderJson :: Json -> ByteString Source #

Convert a `Json` into a `ByteString`