Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-08 Thread Nicolas Pouillard
On Fri, 8 Oct 2010 01:13:20 +0300, Lauri Alanko l...@iki.fi wrote: On Thu, Oct 07, 2010 at 02:45:58PM -0700, Nicolas Pouillard wrote: On Thu, 07 Oct 2010 18:03:48 +0100, Peter Wortmann sc...@leeds.ac.uk wrote: Might be off-topic here, but I have wondered for a while why Haskell doesn't

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-07 Thread Jean-Marie Gaillourdet
Hi, On 06.10.2010, at 22:43, Sterling Clover wrote: On Oct 6, 2010, at 5:39 AM, Simon Marlow wrote: A slightly different suggestion from Simon PJ and myself (we agreed on something syntax-related :-) is the following: \case 1 - f 2 - g where the two-token sequence '\ case'

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-07 Thread Miguel Mitrofanov
Отправлено с iPhone Oct 7, 2010, в 21:03, Peter Wortmann sc...@leeds.ac.uk написал(а): On Tue, 2010-10-05 at 17:10 -0700, Evan Laforge wrote: +1 for something to solve the dummy - m; case dummy of problem. Here are the possibilities I can think of: Might be off-topic here, but I have

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-07 Thread Nicolas Pouillard
On Thu, 07 Oct 2010 18:03:48 +0100, Peter Wortmann sc...@leeds.ac.uk wrote: On Tue, 2010-10-05 at 17:10 -0700, Evan Laforge wrote: +1 for something to solve the dummy - m; case dummy of problem. Here are the possibilities I can think of: Might be off-topic here, but I have wondered for a

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-07 Thread Lauri Alanko
On Thu, Oct 07, 2010 at 02:45:58PM -0700, Nicolas Pouillard wrote: On Thu, 07 Oct 2010 18:03:48 +0100, Peter Wortmann sc...@leeds.ac.uk wrote: Might be off-topic here, but I have wondered for a while why Haskell doesn't support something like follows: do case (- m) of ... With the

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-06 Thread Christopher Done
On 6 October 2010 11:39, Simon Marlow marlo...@gmail.com wrote:   Certainly some existing code would fail to parse, e.g.   (case e of [] - \x - x+1; (x:xs) - \x - x+2) That's definitely a problem. The multi-pattern lambda is nice as I think it follows naturally from function definitions

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-06 Thread Gregory Crosswhite
On 10/06/10 13:32, steffen wrote: A slightly different suggestion from Simon PJ and myself (we agreed on something syntax-related :-) is the following: \case 1 - f 2 - g ... \case { 1 - f; 2 - g } +1 I like this because it has exactly the same properties of Max's case-of, but

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-06 Thread Sterling Clover
On Oct 6, 2010, at 5:39 AM, Simon Marlow wrote: A slightly different suggestion from Simon PJ and myself (we agreed on something syntax-related :-) is the following: \case 1 - f 2 - g where the two-token sequence '\ case' introduces a new optional layout context, the body of

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-06 Thread Dean Herington
At 4:43 PM -0400 10/6/10, Sterling Clover wrote: On Oct 6, 2010, at 5:39 AM, Simon Marlow wrote: A slightly different suggestion from Simon PJ and myself (we agreed on something syntax-related :-) is the following: \case 1 - f 2 - g where the two-token sequence '\ case'

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-06 Thread Evan Laforge
I would also very much like to have multi-argument pattern matching, but in    \case a b - ...          ... it sure suggests to me that `a` should be applied to `b` before casing. I feel like sugar is designed to make a couple of specific uses nicer. Being as general and orthogonal as