pprint package:grisette

Pretty print a value to the standard output.
Pretty printing of values. This class is similar to the Pretty class from the Prettyprinter package, but it also provides pretty printing with a given precedence level. We are able to derive instances of this class for algebraic data types. You may need the DerivingVia and DerivingStrategies extensions.
data X = ... deriving Generic deriving PPrint via (Default X)
The derived instance will pretty print the value with a format similar to the one used by ormolu.
PPrint classes that can be derived for GADTs. This includes:
The arguments to the generic PPrint class.
Controls how to pretty-print a generic representation.
Generic PPrint class.
Derive PPrint instance for a data type.
Derive PPrint1 instance for a data type.
Derive PPrint2 instance for a data type.