# prettyprinter

> Wadler/Leijen pretty-printer for Haskell, Text-based, with annotations and pluggable backends

Source: https://talira.ai/catalog/prettyprinter-6vqgxdqy
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / text / pretty printing](https://talira.ai/categories/libraries/text/pretty-printing), [languages / haskell](https://talira.ai/categories/languages/haskell)
- Licence: BSD-2-Clause[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [David Luposchainsky](https://talira.ai/orgs/david-luposchainsky.md)

prettyprinter is a Haskell pretty-printing library in the Wadler/Leijen tradition: you build a document from small pieces, a layouter fits it to the available width, and a backend renders it as plain Text, to an ANSI terminal (prettyprinter-ansi-terminal) or to a format of your own. It uses Text throughout instead of String, avoids the name clashes of the older wl-pprint API, and lets documents carry annotations such as styling, links or source locations at no cost when unused. The README is itself generated with the library.

## Links

- GitHub: https://github.com/quchen/prettyprinter

## Problems it solves

- pretty-print a syntax tree in Haskell so long lines wrap neatly
- print coloured, aligned output to the terminal from a Haskell program
- replace wl-pprint without its operator name clashes

## Features

- Layouts that fit the output width, with alignment, grouping and separators
- Text-based throughout, with no String definitions
- Annotations for styling, links or source locations, free when unused
- ANSI terminal backend in prettyprinter-ansi-terminal; other backends are small to write
- Runnable examples throughout the documentation

## Trust

Overall: 0.39 out of 1.
Signals: maintenance 0.46, adoption 0.50, momentum 0.17, community 0.62, backing 0.30, extensibility 0.00.

- last commit 2 months ago
- 2 commits in the last 90 days
- latest release v1.7.2 7 months ago
- 310 GitHub stars
- 35 contributors
- backed by David Luposchainsky

## Sources

[^1]: https://github.com/quchen/prettyprinter/blob/master/LICENSE.md (checked 28 Nov 2026)
