
On Aug 20, 2013, at 02:19 , Niklas Broberg
Sadly not - it's theoretically impossible. The fact that you can put comments literally wherever, means that it's impossible to treat them as nodes of the AST. E.g.
f {- WHERE -} x = -- WOULD -- THESE do -- COMMENTS a {- END -} <- g x -- UP return {- ? -} a
"Theoretically impossible". I wouldn't say so. In fact, a system like this was implemented for BETA in the mid 1980'es [1]. The comments where attached to the nearest AST node in an expanded AST. While not _perfect_, it worked pretty well. Granted, it likely is much harder to do for Haskell than BETA, but impossible is a strong word. Tommy [1] http://www.cs.au.dk/~beta/doc/mjolner-overview/mjolner-overview.pdf