one-line-aeson-text-0.1.0.5: Pretty-printing short Aeson values as text
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Aeson.OneLine

Synopsis

Documentation

renderValue :: Value -> Text Source #

Show an aeson value is a one-line format with a single space after each comma and colon, which should be suitable for human reading as long as the value isn't too large.

>>> import Data.Aeson
>>> :{
>>> val = object [ Text.pack "name" .= Text.pack "Alonzo"
>>> , Text.pack "age" .= 3 ]
>>> :}
>>> (putStrLn . Text.unpack . renderValue) val
{"age": 3, "name": "Alonzo"}