Pretty-print haskell source code with comments

喜你入骨 提交于 2019-12-04 04:16:20

Use the Annotated versions of the modules, e.g. Language.Haskell.Exts.Annotated vs Language.Haskell.Exts.

Depending on what kind of pretty printing do you want to do, you might want to take a look at the hscolour package, which is used to colorize Haskell source code into various output formats.

In particular, the module Language.Haskell.HsColour.Classify contains a Haskell tokenizer which preserves whitespace and comments, which might serve as a good starting point.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!