A generic, derivable, haskell pretty printer.

Version on this page:1.2.1
LTS Haskell 21.13:1.2.2
Stackage Nightly 2023-09-30:1.2.2
Latest on Hackage:1.2.2

See all snapshots GenericPretty appears in

BSD-3-Clause licensed by Razvan Ranca
This version can be pinned in stack with:GenericPretty-1.2.1@sha256:0f6af7122f9af012f6893f335b8f8da9ec90d18104d5659ce8500696e9fea3f6,3697

Module documentation for 1.2.1

Depends on 3 packages(full list with versions):
Used by 3 packages in lts-7.24(full list with versions):

GenericPretty is a Haskell library that supports automatic derivation of pretty printing functions on user defined data types.

The form of generics used is based on that introduced in the paper: Magalhaes, Dijkstra, Jeuring, and Loh, A Generic Deriving Mechanism for Haskell, 3'rd ACM Symposium on Haskell, pp. 37-48, September 2010, Changes from the original paper in the GHC implementation are described here:

This package requires the use of the new GHC.Generics features, present from GHC 7.2. Use of these features is indicated by the DeriveGeneric pragma or the flag -XDeriveGeneric.

Pretty printing produces values of type Text.PrettyPrint.Doc, using the Text.PrettyPrint library

The output provided is a pretty printed version of that provided by That is, rendering the document provided by this pretty printer yields an output identical to that of, except for extra whitespace.

For information about the functions exported by the package please see the API linked further down this page. For examples of usage, both basic and more complex see the README file and the haskell source code files in the TestSuite folder, both included in the package. Finally for installation instructions also see the README file or this page: