[Haskell-cafe] Re: [Haskell] ANN: scan-0.1.0.3, a Haskell style scanner

Christian Maeder Christian.Maeder at dfki.de
Mon Apr 19 11:53:48 EDT 2010


Sebastian Fischer schrieb:
> 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

This sort of tabular layout is not supported by scan.

> 
> 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

At least you see a regular pattern wrt column position: (12, 16, 25)

> 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?

It isn't yet implemented.

Cheers Christian

> 
> Sebastian
> 
> [1]: http://people.cs.uu.nl/andres/lhs2tex/
> 


More information about the Haskell-Cafe mailing list