[Haskell-cafe] question automatic indentation (and so on)

Joachim Breitner mail at joachim-breitner.de
Mon Jul 1 14:39:25 CEST 2013


Hi,

Am Montag, den 01.07.2013, 07:59 -0400 schrieb Richard Cobbe:
> How does the indentation tool know if (a b c) is supposed to be the next
> item in the do block, or merely a continuation of the previous application
> of f?

I would still expect the developer to write correctly intended Haskell,
so the the tool would have to employ a Haskell parser to get an AST
(with extra information on where comments were – probably the trickiest
part) and then pretty-prints it.

If it were not for comments, using haskell-src-exts would already
provide a first approximation to the problem, as shown in this script:
https://github.com/djv/small/blob/master/tidy.hs


Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0x4743206C
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130701/20d3a5d6/attachment.pgp>


More information about the Haskell-Cafe mailing list