Pretty Printing in Haskell in 2017

1.6k views Asked by At

The final paragraph of Chapter 5 of Real World Haskell recommends Text.PrettyPrint.HughesPJ for pretty printing rather than custom show types, and provides the originating academic paper for clarifications. A comment on that also linked to:

I've looked for examples using Text.PrettyPrint.HughesPJ, and have not found much online. My questions are:

  1. Is there a module in the Haskellverse approaching the python ease of "from pprint import pprint as pp; pp(myjson)"?
  2. How can I use HughesPJ in a minimum viable example sense that will generate output similar to python's pretty print (in terms of spaces, indentation, etc., on a json object)?
0

There are 0 answers