The JSONPrinter structure
Author: John Reppy
Keywords: Standard ML, SML, SML/NJ Library

The SML of NJ Library
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`).

## See Also

`JSON`, `JSON_STREAM_OUTPUT`, The JSON Library

SML/NJ Version 110.99.9 (November 4, 2025)
Last updated 2025-11-04 15:48:25 UTC