Re: Are pattern guards obsolete?

2006-12-13 Thread Yitzchak Gale
Donald Bruce Stewart [EMAIL PROTECTED] wrote: The joy of pattern guards reveals once you have more conditions. I wrote: Of course, this is not really the joy of pattern guards. It is the joy of monads, with perhaps a few character strokes saved by a confusing overloading of (-). Philippa

Re: Are pattern guards obsolete?

2006-12-13 Thread Philippa Cowderoy
On Wed, 13 Dec 2006, Yitzchak Gale wrote: Yitzchak Gale wrote: Of course, this is not really the joy of pattern guards. It is the joy of monads, with perhaps a few character strokes saved by a confusing overloading of (-). Philippa Cowderoy wrote: I don't find it any more

Re: Are pattern guards obsolete?

2006-12-13 Thread Philippa Cowderoy
On Wed, 13 Dec 2006, Yitzchak Gale wrote: Philippa Cowderoy wrote: I don't find it any more confusing than the overloading of -. I wrote: You mean that it is used both for lambda abstractions and for functional dependencies? True, but those are so different that there is no

Re: Are pattern guards obsolete?

2006-12-13 Thread Yitzchak Gale
Philippa Cowderoy wrote: This is what I get for replying straight away! Oh, no, I'm happy that you responded quickly. I think my point is that I'm not aware of many people who actually think this is a problem or get confused. Well, I don't mean that this is something that experienced

Re: Are pattern guards obsolete?

2006-12-13 Thread Iavor Diatchki
Hi, I am not clear why you think the current notation is confusing... Could you give a concrete example? I am thinking of something along the lines: based on how - works in list comprehensions and the do notation, I would expect that pattern guards do XXX but instead, they confusingly do YYY.

Re: Are pattern guards obsolete?

2006-12-13 Thread apfelmus
Iavor Diatchki wrote: I am not clear why you think the current notation is confusing... Could you give a concrete example? I am thinking of something along the lines: based on how - works in list comprehensions and the do notation, I would expect that pattern guards do XXX but instead, they

Re: Are pattern guards obsolete?

2006-12-13 Thread Claus Reinke
I am not clear why you think the current notation is confusing... Could you give a concrete example? I am thinking of something along the lines: based on how - works in list comprehensions and the do notation, I would expect that pattern guards do XXX but instead, they confusingly do YYY. I

Re: Are pattern guards obsolete?

2006-12-13 Thread Neil Mitchell
Hi in spite of their similarity, all of these constructs handle some of the monadic aspects differently. the translations of pattern guards not only embed statements in guard, they also embed the right hand sides of generators in return. translations of list comprehensions only lift statements.

Re: Are pattern guards obsolete?

2006-12-13 Thread Dave Menendez
Yitzchak Gale writes: Philippa Cowderoy wrote: I don't find it any more confusing than the overloading of -. I wrote: You mean that it is used both for lambda abstractions and for functional dependencies? True, but those are so different that there is no confusion. Oh, and case.