简体   繁体   中英

Where can I find a full parenthesizer for Haskell?

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.

尝试ghc -ddump-parsed

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM