Re: List syntax (was: Re: help from the community?)

2007-02-03 Thread Brian Hulley
Douglas Philips wrote: On 2007 Feb 3, at 2:55 AM, Brian Hulley indited: I know, I find the need to manually delete and insert commas extremely tedious as well. This is why I proposed: ... I like that. (I haven't done enough analysis on the layout part of the grammar to personally make su

Re: List syntax (was: Re: help from the community?)

2007-02-02 Thread Brian Hulley
Douglas Philips wrote: On 2007 Feb 2, at 11:25 PM, Brian Hulley indited: Apart from the extra possibility for errors (yes I understood that you'd define it to not be an error but this doesn't change the fact that for people who always wrote their tuples using the normal mathematical

Re: List syntax (was: Re: help from the community?)

2007-02-02 Thread Brian Hulley
Douglas Philips wrote: On 2007 Feb 2, at 1:03 PM, Neil Mitchell indited: Personally I'd make the rule that trailing commas are never allowed, anywhere, but I do see an argument for adding them to import lists. You just highlighted the inconsistency: You refer to "import lists"... you appear to

Re: List syntax (was: Re: help from the community?)

2007-02-02 Thread Brian Hulley
Douglas Philips wrote: What would be the proper way to propose that: ( exp1 , ... , expk ) (tuple, k>=2) [ exp1 , ... , expk ] (list, k>=1) be amended to: ( exp1 , ... , expk [ , ] ) (tuple, k>=2) [ exp1 , ... , expk [ , ] ] (list, k>=1) I think a problem with the above proposal is that by a

Re: help from the community?

2007-02-01 Thread Brian Hulley
Taral wrote: On 1/31/07, Conor McBride <[EMAIL PROTECTED]> wrote: So, as far as Haskell' is concerned, I'd favour forbidding non-empty cases, but only because I favour having some more explicit syntax for empty cases, further down the line. I see nothing wrong with "case x of {}", with require

Re: help from the community?

2007-01-30 Thread Brian Hulley
Andres Loeh wrote: The only reasons that I could see in favor of allowing empty "forall"s is that it might be easier to automatically generate code. Haskell seems to be a bit inconsistent in how it treats empty constructs. For example, empty let and empty where seems to be allowed, but not an emp

Re: [Haskell] Views in Haskell

2007-01-29 Thread Brian Hulley
Claus Reinke wrote: mapA f (nilAP -> ()) = nilA mapA f (consAP -> (h,t)) = consA (f h) (mapA f t) foldA f n (nilAP -> ())= n foldA f n (consAP -> (h,t)) = f h (foldA f n t) To me this exactly illustrates why view patterns are a bad idea: you've taken some concrete type,

Re: [Haskell] Views in Haskell

2007-01-24 Thread Brian Hulley
On Wednesday, January 24, 2007 10:02 AM, Dinko Tenev wrote: On 1/24/07, Brian Hulley <[EMAIL PROTECTED]> wrote: A possible syntax could represent the value being matched explicitly, say using ? to represent the value currently being matched, then the pattern could be written as an eq

Re: [Haskell] Views in Haskell

2007-01-23 Thread Brian Hulley
Simon Peyton-Jones wrote: http://hackage.haskell.org/trac/haskell-prime/wiki/ViewPatterns I'm thinking of implementing it in GHC, so I'd be interested in feedback of the form - how desirable is it to have a feature of this general form? - can this particular proposal be improved