[Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

Tommy Thorn tt1729 at yahoo.com
Wed Aug 21 07:16:02 CEST 2013

On Aug 20, 2013, at 02:19 , Niklas Broberg <niklas.broberg at gmail.com> wrote:
> 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.

[1] http://www.cs.au.dk/~beta/doc/mjolner-overview/mjolner-overview.pdf

More information about the Haskell-Cafe mailing list