liveBook · Manning

Pretty printing

Pretty printing is the formatted rendering of structured information as human-readable text through layout, spacing, indentation, and line breaks.

How 3 Manning books explain it

Fabulous Adventures in Data Structures and Algorithms

Pretty printing is the automated formatting of source code to produce a readable layout under spacing and indentation constraints.

How it is used
Formats source code for consistent readability, structural indentation, bounded line width, and reduced vertical clutter.
How deep it goes
Descends from layout goals to parse-tree transformation, doc graphs, greedy rendering, explicit stacks, and visitor-based organization.
Examples
Uses irregularly spaced expressions, conditional statements, comments, delimited comments, and immutable C# expression-tree records.
What you can do after
Build it from scratch as a simplified, nonrecursive formatter with separate parse-tree, doc, rendering, and visitor layers.

Read how Fabulous Adventures in Data Structures and Algorithms explains pretty printing →

Clojure: The Essential Reference

Pretty printing is the generation of human-readable textual representations with structured layout and spacing.

How it is used
Improves REPL readability, source-code presentation, tabular display, and controlled output for large or nested values.
How deep it goes
Explains entry points, dispatch, dynamic controls, truncation, margins, streams, bases, and tables, without detailing printer internals.
Examples
Uses nested maps and collections, RSS XML data, Clojure forms, macroexpansion, numeric bases, output files, and printed tables.
What you can do after
Operate/configure clojure.pprint to display data, format code, constrain output, write streams, and render tables.

Read how Clojure: The Essential Reference explains pretty printing →

Learn Haskell by Example

Pretty printing is the rendering of structured information in a human-readable textual format.

How it is used
Uses pretty printing to render CSV data for users and add readable column summaries.
How deep it goes
Defines a PrettyCsv model and rendering interface, but leaves conversion, summaries, and formatting algorithms as exercises.
Examples
Uses PrettyCsv fields and fromCsv, withSummaries, pretty, and prettyText as concrete design examples.
What you can do after
Build it from scratch by converting Csv to PrettyCsv, adding summaries, and implementing textual rendering.

Read how Learn Haskell by Example explains pretty printing →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.