tags:

views:

155

answers:

3

Is there a way in GHCI to show a fully parenthesized version of a statement? I've found myself wanting to do that sometimes to help me understand a piece of code that I'm not familiar with. Sometimes the conciseness of the masters obscure things for us n00bs, and anything to help me break these beasts apart seems to help.

+3  A: 

Try ghc -ddump-parsed.

Logan Capaldo
+2  A: 

A number of approaches are documented on the wiki: http://haskell.org/haskellwiki/Indent#Indenting_Haskell_Mechanically

Don Stewart
+1  A: 

Perhaps not directly relating to your question, but I often find point-free code hard to read. Incidentally, the tool to generate a point-free form for expressions, can also do the opposite. For example:

 > unpl const . (1 +)
 (\ e _ -> 1 + e)

Much better! :)

nominolo