Wadler-Lindig document algebra and layout engine. Generic — no meme-specific knowledge. Reusable for any pretty-printing task.
Doc types form a small algebra: DocText — literal string DocLine — newline+indent (or flat-alt when flat) DocCat — concatenation DocNest — increase indent DocGroup — try flat, break if too wide DocIfBreak — conditional on flat/break mode
layout renders a Doc tree to a string at a given page width. Use ##Inf for single-line (flat) rendering.
Wadler-Lindig document algebra and layout engine. Generic — no meme-specific knowledge. Reusable for any pretty-printing task. Doc types form a small algebra: DocText — literal string DocLine — newline+indent (or flat-alt when flat) DocCat — concatenation DocNest — increase indent DocGroup — try flat, break if too wide DocIfBreak — conditional on flat/break mode layout renders a Doc tree to a string at a given page width. Use ##Inf for single-line (flat) rendering.
(layout doc width)Render a Doc tree as a string at the given page width. Use ##Inf for flat (single-line) rendering.
Render a Doc tree as a string at the given page width. Use ##Inf for flat (single-line) rendering.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |