RE: Proposal: Scoping rule change

2012-07-27 Thread Sittampalam, Ganesh
: Scoping rule change Hello, I also think that this is a good idea. To address Manuel's nitpick, here is an example that would break if `I` starts exporting `foo`. module M(foo) where import I foo = True To Ganesh's point: I think that this change would be useful, even if one is willing

Re: Proposal: Scoping rule change

2012-07-25 Thread Manuel M T Chakravarty
Nitpick: Your example actually does not lead to an error with GHC, as you define, but do not use 'foo' in M. Names (like classes) only clash when you look them up. Manuel Lennart Augustsson lenn...@augustsson.net: It's not often that one gets the chance to change something as fundamental as

Re: Proposal: Scoping rule change

2012-07-25 Thread Manuel M T Chakravarty
If Lennart's suggestion is combined with GHC's lazy checking for name clashes (i.e., only check if you ever look a name up in a particular scope), it would also work in your example. Manuel Sittampalam, Ganesh ganesh.sittampa...@credit-suisse.com: If you’re using unqualified and unrestricted

RE: Proposal: Scoping rule change

2012-07-25 Thread Sittampalam, Ganesh
The ... foo ... in my example was intended to show that module M does look up 'foo'. From: Manuel M T Chakravarty [mailto:c...@cse.unsw.edu.au] Sent: 25 July 2012 08:26 To: Sittampalam, Ganesh Cc: Lennart Augustsson; Haskell Prime Subject: Re: Proposal: Scoping rule change If Lennart's

RE: Proposal: Scoping rule change

2012-07-25 Thread Sittampalam, Ganesh
To: Sittampalam, Ganesh Cc: Lennart Augustsson; Haskell Prime Subject: Re: Proposal: Scoping rule change If Lennart's suggestion is combined with GHC's lazy checking for name clashes (i.e., only check if you ever look a name up in a particular scope), it would also

RE: Proposal: Scoping rule change

2012-07-24 Thread Sittampalam, Ganesh
If you're using unqualified and unrestricted imports, there's still the risk that another module will export something you care about, e.g. module M where import I -- currently exports foo import J -- might be changed in future to export foo ... foo ... So I think you need to use

Re: Proposal: Scoping rule change

2012-07-24 Thread Edward Kmett
+1 from me I can't count the number of times I've had this bite me when writing ByteString-like APIs that pun names from the Prelude. On Jul 23, 2012, at 8:28 PM, Lennart Augustsson lenn...@augustsson.net wrote: It's not often that one gets the chance to change something as fundamental as

Re: Proposal: Scoping rule change

2012-07-23 Thread Greg Weber
sounds good. will there be a shadowing warning? On Mon, Jul 23, 2012 at 5:28 PM, Lennart Augustsson lenn...@augustsson.net wrote: It's not often that one gets the chance to change something as fundamental as the scoping rules of a language. Nevertheless, I would like to propose a change to

Re: Proposal: Scoping rule change

2012-07-23 Thread Lennart Augustsson
An optional shadowing warning (for the paranoid) seems reasonable. On Tue, Jul 24, 2012 at 1:45 AM, Greg Weber g...@gregweber.info wrote: sounds good. will there be a shadowing warning? On Mon, Jul 23, 2012 at 5:28 PM, Lennart Augustsson lenn...@augustsson.net wrote: It's not often that