haskell-suite / haskell-src-exts

Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer
Other
193 stars 94 forks source link

exactPrint throws Prelude.init: empty list. #426

Open Magicloud opened 5 years ago

Magicloud commented 5 years ago

The problem occurs when I exactPrint :: Decl SrcSpanInfo -> [Comment].

I suspect this is caused by my changes to the Decl. But, the error seems unhandled and hard to debug.

mpickering commented 5 years ago

The exactPrint functionality is barely maintained but easy to fix if someone takes a careful look at it. It is likely that your changes to the decl are causing it as the mechanism is quite fragile.

Magicloud commented 5 years ago

I see. Thanks.