On Mon, Jul 1, 2013 at 9:56 AM, Tikhon Jelvis <tik...@jelv.is> wrote:

> I've thought about writing an automatic indenting tool for Haskell (or,
> more accurately, a pretty-printer) for another project I have, and this is
> the main thing that threw me off. While automatic indentation might make
> sense for less expressive languages (Google Go being an extreme example), I
> think it would be too constraining for Haskell. After all, in reasonable
> code, chances are that similar constructs end up meaning wildly different
> things (especially with the advent of pervasive embedded DSLs), so the code
> itself is a poor indicator of its own structure.
>

One might look at the history of the indentation modules for Emacs
haskell-mode. Short version: they gave up, tab iterates through the
possibilities because it's quite impossible to know which one is correct
without a *semantic*, not just syntactic, understanding of the code.
(Which, when you think about it, is pretty much par for the Haskell
language definition. See also the literally impossible brace insertion rule
of Haskell98.)

-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to