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.
Try ghc -ddump-parsed
.
A number of approaches are documented on the wiki: http://haskell.org/haskellwiki/Indent#Indenting_Haskell_Mechanically
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! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With