The JSONPrinter structure

The JSONPrinter structure implements a printer for the JSON.value type.

Synopsis

structure JSONPrinter

Interface

val print : TextIO.outstream * JSON.value -> unit
val print' : {strm : TextIO.outstream, pretty : bool} -> JSON.value -> unit

Description

val print : TextIO.outstream * JSON.value -> unit

print (outS, jv) prints the JSON value jv to the outstream outS in condensed format (i.e., without newlines or indentation).

val print' : {strm : TextIO.outstream, pretty : bool} -> JSON.value -> unit

print' {outS, pretty} jv prints the JSON value jv to the outstream outS, where the value of the pretty field controls whether the output is condensed (when pretty is false) or printed with new lines and indentation to improve readability (when pretty is true).