Re: Poll: Error message spans

2010-01-06 Thread Alexander Dunlap
On Wed, Jan 6, 2010 at 3:35 AM, Ian Lynagh  wrote:
>
> Hi all,
>
> Currently, when GHC reports an error it only gives a source position,
> not a source span. For example, with this module:
>
>    main = print (f (const 'x' 'x') 'y')
>    f xs y = xs ++ [y]
>
> you get an error starting:
>
>    u.hs:1:18:
>        Couldn't match expected type `[a]' against inferred type `Char'
>
> There's a (probably little-known) flag -ferror-spans with which you get
> this error instead:
>
>    u.hs:1:18-30:
>        Couldn't match expected type `[a]' against inferred type `Char'
>
> i.e. rather than just giving the start column number 18, it gives you
> the span 18-30 (the "const 'x' 'x'").
>
>
> Would you find the extra information useful, or just noise?
> i.e. should we show error spans by default?
>
>
> Thanks
> Ian
>
> ___
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>

I certainly wouldn't find it distracting, and I think it could be
quite useful in many cases. I vote for turning it on by default.

Alex
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: Associativity of ViewPatterns

2010-01-06 Thread Simon Peyton-Jones
Good point. I'll fix that, in HEAD at least.

Simon

| -Original Message-
| From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users-
| boun...@haskell.org] On Behalf Of Bas van Dijk
| Sent: 06 January 2010 12:44
| To: glasgow-haskell-users@haskell.org
| Subject: Associativity of ViewPatterns
| 
| Hello,
| 
| Why is the following a syntax error:
| 
| f (view1 -> view2 -> pattern) = ...
| 
| and the following isn't:
| 
| f (view1 -> (view2 -> pattern)) = ...
| 
| I would prefer the first version.
| 
| regards,
| 
| Bas
| ___
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Associativity of ViewPatterns

2010-01-06 Thread Bas van Dijk
Hello,

Why is the following a syntax error:

f (view1 -> view2 -> pattern) = ...

and the following isn't:

f (view1 -> (view2 -> pattern)) = ...

I would prefer the first version.

regards,

Bas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Poll: Error message spans

2010-01-06 Thread Bulat Ziganshin
Hello Ian,

Wednesday, January 6, 2010, 2:35:09 PM, you wrote:

> Would you find the extra information useful, or just noise?
> i.e. should we show error spans by default?

i think it's useful in some cases, and don't add noticeable visual
overhead in remaining ones


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Poll: Error message spans

2010-01-06 Thread Ian Lynagh

Hi all,

Currently, when GHC reports an error it only gives a source position,
not a source span. For example, with this module:

main = print (f (const 'x' 'x') 'y')
f xs y = xs ++ [y]

you get an error starting:

u.hs:1:18:
Couldn't match expected type `[a]' against inferred type `Char'

There's a (probably little-known) flag -ferror-spans with which you get
this error instead:

u.hs:1:18-30:
Couldn't match expected type `[a]' against inferred type `Char'

i.e. rather than just giving the start column number 18, it gives you
the span 18-30 (the "const 'x' 'x'").


Would you find the extra information useful, or just noise?
i.e. should we show error spans by default?


Thanks
Ian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users