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:
- https://hackage.haskell.org/package/FPretty-1.0/docs/Text-PrettyPrint-FPretty.html
- http://www.cs.kent.ac.uk/people/staff/oc/pretty.html
I've looked for examples using Text.PrettyPrint.HughesPJ, and have not found much online. My questions are:
- Is there a module in the Haskellverse approaching the python ease of "from pprint import pprint as pp; pp(myjson)"?
- 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)?