Question

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.

Was it helpful?

Solution

OTHER TIPS

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! :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top