[Haskell] pretty-printing Haskell with automatic parens?

Norman Ramsey nr at eecs.harvard.edu
Mon Oct 15 13:39:07 EDT 2007

 > The haskell-src package contains a pretty-printer for Haskell syntax that
 > requires parentheses to be explicitly placed in the (abstract) syntax
 > representation.  I have some code for automatically inserting parentheses
 > where necessary (for use before pretty-printing), but I'm guessing someone
 > else has done so better than I.  Does anyone have pointers?  I'm glad to
 > share my version as well.


I don't have code, but I did publish an algorithm for inserting
parentheses minimally:  http://tinyurl.com/24xbp7
There's code on that page but I'm sorry to say it's ML code :-(


More information about the Haskell mailing list