Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-16 Thread Bertram Felgenhauer
Duncan Coutts wrote: On Wed, 2007-08-15 at 11:06 -0700, Stefan O'Rear wrote: foo = getSomethingCPS $ \ arg - moreStuff is now a syntax error (\ { varid - } matches no productions). I'm not sure I follow. The patterns would have to match up in a column, so foo =

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-16 Thread Thomas Schilling
On 16 aug 2007, at 13.46, Bertram Felgenhauer wrote: Duncan Coutts wrote: On Wed, 2007-08-15 at 11:06 -0700, Stefan O'Rear wrote: foo = getSomethingCPS $ \ arg - moreStuff is now a syntax error (\ { varid - } matches no productions). I'm not sure I follow. The patterns would have

[Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brian Hulley
Hi, On http://hackage.haskell.org/trac/haskell-prime/wiki/LambdaCase the proposed syntax for lambda case is: case of alts but this has a really bad downside for interactive editors: it doesn't allow one to distinguish between an incomplete construct and a completed construct thus

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Stefan O'Rear
On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we stipulate that unlike a case (but like a lambda) you

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Duncan Coutts
On Wed, 2007-08-15 at 11:06 -0700, Stefan O'Rear wrote: Why not just: sumTo0 = foldr (\0 k - 0 n k - n + k) 0 Because it would break a very large amount of old code, and I think H' was supposed to be upward compatible: Aye, that'd be bad. foo = getSomethingCPS $ \

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brian Hulley
Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we stipulate that unlike a case

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brandon Michael Moore
On Wed, Aug 15, 2007 at 11:06:36AM -0700, Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions,

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Isaac Dupree
Duncan Coutts wrote: On Wed, 2007-08-15 at 18:23 +0100, Brian Hulley wrote: Therefore I propose: \of alts which doesn't suffer this problem since the keyword of can never follow a '\' in the existing grammar. Or how about: \case of alts which seems clearer to me.

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Dan Weston
I came really late to this discussion, so I assume someone has already proposed using (Control.Applicative.|) to select the first matching pattern of an unnamed cased object. Can someone point me to where that was proposed and why it was rejected? Dan Weston Isaac Dupree wrote: Duncan