Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-16 Thread Wolfgang Jeltsch
Am Freitag, den 13.07.2012, 13:40 +0100 schrieb Ross Paterson:
 Remember that there is a \ in arrow notation in addition to proc.
 So one might expect any abbreviation for \x - case x of {...}
 to mean the same \ thing in arrow notation too.

I completely agree. I had forgotten about the \ in arrow notation.

 If the abbreviation contained no \, there would be no way to replace
 it with a proc.

Exactly. It seems, however, that it has finally been decided to use the
syntax with \case, so all looks good so far. :-) 

Best wishes,
Wolfgang



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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-16 Thread Wolfgang Jeltsch
Am Montag, den 16.07.2012, 21:26 +0300 schrieb Wolfgang Jeltsch:
 Am Freitag, den 13.07.2012, 13:40 +0100 schrieb Ross Paterson:
  Remember that there is a \ in arrow notation in addition to proc.
  So one might expect any abbreviation for \x - case x of {...}
  to mean the same \ thing in arrow notation too.
 
 I completely agree. I had forgotten about the \ in arrow notation.

I have opened a new ticket for arrow analogs of lambda case and
multi-way if:

http://hackage.haskell.org/trac/ghc/ticket/7081

Best wishes,
Wolfgang


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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-13 Thread Daniel Trstenjak

On Thu, Jul 12, 2012 at 03:13:42PM -0400, Cale Gibbard wrote:
 There are of course already lots of ways to create functions which
 don't involve \

Well, I think it should be clear that we're talking here about
anonymous functions.

 We're not exactly talking about function definitions, so much as
 expressions whose value happens to be a function. The point is just
 that there are already a few other places in the syntax where the
 omission of a value results in a function having the omitted value as
 its parameter. At least to me, it seems natural to extend that pattern
 in this case.

The question is, how self explanatory is the syntax? I think that
sections and partial function application are pretty self explanatory
just by looking at the expression, because it tells you visually pretty
well what it actually does.

'case of {}' isn't self explanatory, because you don't have a visual
hint what happend with the parameter between 'case' and 'of'.

I can see why - I think it was Simon - proposed '\of', because you could
read it as if the parameter between 'case' and 'of' is applied to the 'of'.

I don't like the version 'case of {}' and I even don't like the version
'\case of' that much, because I think both versions degrade the syntax
of Haskell, which is part of the beauty of Haskell and we shouldn't rush
in expanding it, only for pragmatic reasons.


Greetings,
Daniel

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-13 Thread Wolfgang Jeltsch
Am Donnerstag, den 12.07.2012, 13:38 -0400 schrieb Cale Gibbard:
 Personally I don't see why everyone appears to prefer the syntax with
 \ in it over just the obvious case section syntax which was originally
 proposed.
 
 case of { ... }
 
 looks much better to me than
 
 \case of { ... }
 
 and the former makes sense to me as a simple extension of operator
 sections to another part of the syntax.
 
 Does anyone else agree?

I’m strongly opposed to the

case of { ... }

syntax, because there seems to be no natural arrow expression analog of
it.

A notation that starts with \ (like “\case”) can be carried over to
arrow expressions by replacing the \ with proc (like in “proc case”).

Best wishes,
Wolfgang


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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-13 Thread Ross Paterson
On Fri, Jul 13, 2012 at 01:21:25PM +0100, Wolfgang Jeltsch wrote:
 I’m strongly opposed to the
 
 case of { ... }
 
 syntax, because there seems to be no natural arrow expression analog of
 it.
 
 A notation that starts with \ (like “\case”) can be carried over to
 arrow expressions by replacing the \ with proc (like in “proc case”).

Remember that there is a \ in arrow notation in addition to proc.
So one might expect any abbreviation for \x - case x of {...}
to mean the same \ thing in arrow notation too.  If the abbreviation
contained no \, there would be no way to replace it with a proc.

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-13 Thread Gábor Lehel
On Thu, Jul 12, 2012 at 7:38 PM, Cale Gibbard cgibb...@gmail.com wrote:
 Personally I don't see why everyone appears to prefer the syntax with
 \ in it over just the obvious case section syntax which was originally
 proposed.

 case of { ... }

 looks much better to me than

 \case of { ... }

 and the former makes sense to me as a simple extension of operator
 sections to another part of the syntax.

 Does anyone else agree?


I also completely agree, but I don't want my opinion to get in the way
of progress.


-- 
Your ship was caught in a monadic eruption.

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-13 Thread Brandon Allbery
On Fri, Jul 13, 2012 at 9:12 PM, Gábor Lehel illiss...@gmail.com wrote:

 On Thu, Jul 12, 2012 at 7:38 PM, Cale Gibbard cgibb...@gmail.com wrote:
  case of { ... }
 
  looks much better to me than
 
  \case of { ... }

 I also completely agree, but I don't want my opinion to get in the way
 of progress.


I don't much care whether what is implemented is \case or case of or
even \of (even though that last reads weird), but \case of strikes me
as including syntactic noise (a pointless extra token).  One or the other;
not both.

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-12 Thread Cale Gibbard
Personally I don't see why everyone appears to prefer the syntax with
\ in it over just the obvious case section syntax which was originally
proposed.

case of { ... }

looks much better to me than

\case of { ... }

and the former makes sense to me as a simple extension of operator
sections to another part of the syntax.

Does anyone else agree?

On 6 July 2012 20:40, Chris Smith cdsm...@gmail.com wrote:
 Whoops, my earlier answer forgot to copy mailing lists... I would love to
 see \of, but I really don't think this is important enough to make case
 sometimes introduce layout and other times not.  If it's going to obfuscate
 the lexical syntax like that, I'd rather just stick with \x-case x of.

 On Jul 6, 2012 3:15 PM, Strake strake...@gmail.com wrote:

 On 05/07/2012, Mikhail Vorozhtsov mikhail.vorozht...@gmail.com wrote:
  Hi.
 
  After 21 months of occasional arguing the lambda-case proposal(s) is in
  danger of being buried under its own trac ticket comments. We need fresh
  blood to finally reach an agreement on the syntax. Read the wiki
  page[1], take a look at the ticket[2], vote and comment on the
  proposals!
 

 +1 for \ of multi-clause lambdas

 It looks like binding of to me, which it ain't, but it is nicely
 brief...

 ___
 Haskell-Cafe mailing list
 haskell-c...@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


 ___
 Haskell-Cafe mailing list
 haskell-c...@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-12 Thread Daniel Trstenjak

On Thu, Jul 12, 2012 at 01:38:56PM -0400, Cale Gibbard wrote:
 Personally I don't see why everyone appears to prefer the syntax with
 \ in it over just the obvious case section syntax which was originally
 proposed.

I don't think that the 'case section syntax' is obvious, because I don't
see the similarity between a function definition and a partial function
application.

Always using '\' would be a visual hint for a function definition.


Greetings,
Daniel

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-12 Thread Cale Gibbard
There are of course already lots of ways to create functions which
don't involve \

I mentioned sections (like (+1) desugaring to (\x - x + 1)) already,
and of course, one can partially apply or compose and transform other
functions without explicit lambdas.

We're not exactly talking about function definitions, so much as
expressions whose value happens to be a function. The point is just
that there are already a few other places in the syntax where the
omission of a value results in a function having the omitted value as
its parameter. At least to me, it seems natural to extend that pattern
in this case.

On 12 July 2012 15:03, Daniel Trstenjak daniel.trsten...@gmail.com wrote:

 On Thu, Jul 12, 2012 at 01:38:56PM -0400, Cale Gibbard wrote:
 Personally I don't see why everyone appears to prefer the syntax with
 \ in it over just the obvious case section syntax which was originally
 proposed.

 I don't think that the 'case section syntax' is obvious, because I don't
 see the similarity between a function definition and a partial function
 application.

 Always using '\' would be a visual hint for a function definition.


 Greetings,
 Daniel

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-12 Thread John Lask

On 13/07/2012 3:08 AM, Cale Gibbard wrote:

Personally I don't see why everyone appears to prefer the syntax with
\ in it over just the obvious case section syntax which was originally
proposed.

case of { ... }

looks much better to me than

\case of { ... }

and the former makes sense to me as a simple extension of operator
sections to another part of the syntax.

Does anyone else agree?



yes.
I prefer case of rather than \case of for aesthetic reasons.

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-06 Thread Herbert Valerio Riedel
Christopher Done chrisd...@gmail.com writes:

 P.S. \if then … else …?

btw, http://www.haskell.org/haskellwiki/If-then-else

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-06 Thread Strake
On 05/07/2012, Mikhail Vorozhtsov mikhail.vorozht...@gmail.com wrote:
 Hi.

 After 21 months of occasional arguing the lambda-case proposal(s) is in
 danger of being buried under its own trac ticket comments. We need fresh
 blood to finally reach an agreement on the syntax. Read the wiki
 page[1], take a look at the ticket[2], vote and comment on the proposals!


+1 for \ of multi-clause lambdas

It looks like binding of to me, which it ain't, but it is nicely brief...

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-06 Thread Chris Smith
Whoops, my earlier answer forgot to copy mailing lists... I would love to
see \of, but I really don't think this is important enough to make case
sometimes introduce layout and other times not.  If it's going to obfuscate
the lexical syntax like that, I'd rather just stick with \x-case x of.
On Jul 6, 2012 3:15 PM, Strake strake...@gmail.com wrote:

 On 05/07/2012, Mikhail Vorozhtsov mikhail.vorozht...@gmail.com wrote:
  Hi.
 
  After 21 months of occasional arguing the lambda-case proposal(s) is in
  danger of being buried under its own trac ticket comments. We need fresh
  blood to finally reach an agreement on the syntax. Read the wiki
  page[1], take a look at the ticket[2], vote and comment on the proposals!
 

 +1 for \ of multi-clause lambdas

 It looks like binding of to me, which it ain't, but it is nicely brief...

 ___
 Haskell-Cafe mailing list
 haskell-c...@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread Christopher Done
I like \case as is proposed. It seems the least controversial one and
there's curry (\case ) for two-args, but even that seems a rare case.

For what it's worth, I like the idea of omission being partiality, as
in case of and if then. It seems perfectly natural to me, I don't need
a \ to tell me that an expression will result in a function. But some
do. So I'll go along with and vote for \case. The lack of a lambda
case is one of the few legitimate complaints I have about Haskell's
syntax so it would be marvey to see it in GHC.

P.S. \if then … else …?

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread Felipe Almeida Lessa
On Thu, Jul 5, 2012 at 12:21 PM, Christopher Done chrisd...@gmail.com wrote:
 I like \case as is proposed. It seems the least controversial one and
 there's curry (\case ) for two-args, but even that seems a rare case.

 For what it's worth, I like the idea of omission being partiality, as
 in case of and if then. It seems perfectly natural to me, I don't need
 a \ to tell me that an expression will result in a function. But some
 do. So I'll go along with and vote for \case. The lack of a lambda
 case is one of the few legitimate complaints I have about Haskell's
 syntax so it would be marvey to see it in GHC.

+1 for \case, I completely agree with Christopher Done.

Cheers,

-- 
Felipe.

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


Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread Gábor Lehel
On Thu, Jul 5, 2012 at 5:21 PM, Christopher Done chrisd...@gmail.com wrote:
 I like \case as is proposed. It seems the least controversial one and
 there's curry (\case ) for two-args, but even that seems a rare case.

 For what it's worth, I like the idea of omission being partiality, as
 in case of and if then. It seems perfectly natural to me, I don't need
 a \ to tell me that an expression will result in a function. But some
 do. So I'll go along with and vote for \case. The lack of a lambda
 case is one of the few legitimate complaints I have about Haskell's
 syntax so it would be marvey to see it in GHC.

I agree. I think the partial application metaphor in case of is very
nice, but \case is okay enough, so I'm voting for whatever is most
popular as long as it does the job and doesn't break compatibility.


 P.S. \if then … else …?


I'd prefer just getting a function of type a - a - Bool - a and
partially applying it. We need a language level solution for case
because case of is fundamental and you can't do that. But if then else
is just sugar.
(That being said one of my principles is to trust people not to make
their own code ugly on purpose, so if people really want partially
applied if then else then I guess let them have it else who cares. But
I don't really see the case for it.)


-- 
Your ship was caught in a monadic eruption.

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