[Haskell-cafe] Re: [Haskell] ANN: scan-0.1.0.3,
a Haskell style scanner
Sebastian Fischer
sebf at informatik.uni-kiel.de
Mon Apr 19 11:44:14 EDT 2010
Hello Christian,
On Apr 19, 2010, at 4:48 PM, Christian Maeder wrote:
> I like to announce a Haskell style scanner at
> http://hackage.haskell.org/package/scan
>
> Feedback is welcome.
I get lots of "multiple blanks" which I'd rather not "correct".
I often use multiple blanks to achieve vertical layout which is
especially useful in combination with lhs2TeX [1] whose polycode mode
requires multiple blanks to achieve proper indentation.
This code
instance Eq a => Eq (Maybe a) where
Nothing == Nothing = True
Just x == Just y = x == y
_ == _ = False
triggers this scan output:
scan-test.hs:2:10: up to column 12 multiple (2) blanks
scan-test.hs:2:14: up to column 16 multiple (2) blanks
scan-test.hs:2:23: up to column 25 multiple (2) blanks
scan-test.hs:3:9: up to column 12 multiple (3) blanks
scan-test.hs:3:14: up to column 16 multiple (2) blanks
scan-test.hs:3:22: up to column 25 multiple (3) blanks
scan-test.hs:4:4: up to column 12 multiple (8) blanks
scan-test.hs:4:14: up to column 16 multiple (2) blanks
scan-test.hs:4:17: up to column 25 multiple (8) blanks
I very much prefer the previous indentation over the following version
stripped down by scan - (using the hyphen option):
instance Eq a => Eq (Maybe a) where
Nothing == Nothing = True
Just x == Just y = x == y
_ == _ = False
I did not find a way to configure scan to ignore "multiple blanks".
Did I miss it?
Sebastian
[1]: http://people.cs.uu.nl/andres/lhs2tex/
--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)
More information about the Haskell-Cafe
mailing list