Re: [Haskell] No Pattern Guards

2005-03-28 Thread Claus Reinke
> Now generalize it to more than two cases, or one where the second case > needs to pattern match too. The magic of pattern guards is not in a > single guarding expression, but in a function with many different cases > which use pattern guards. MonadPlus is your friend, especially if (fail s) is m

Re: [Haskell] No Pattern Guards

2005-03-28 Thread Malcolm Wallace
John Meacham <[EMAIL PROTECTED]> writes: > Oddly enough, I was looking over the old Haskell discussions, and > pattern guards were supposed to make it into Haskell 98 according to the > decision. Any idea what happened? did someone just forget to write them > up or was there further discussion els

Re: [Haskell] How to substract a list?

2005-03-28 Thread Mads Lindstrøm
Hi Bright Sun wrote: > Hi, > > Tks, this is not what I wanted. > > I want remove pairs list, > > [(5,1),(4,1),(3,1),(2,1),(1,1)] remove [(2,1),(1,1)] > [(5,1),(4,1),(3,1)] [(5,1),(4,1),(3,1),(2,1),(1,1)] \\ [(2,1),(1,1)] should give the right result. Befere using the '\\' operator you may n

Re: [Haskell] No Pattern Guards

2005-03-28 Thread John Meacham
On Mon, Mar 28, 2005 at 02:17:46PM +0200, Yitzchak Gale wrote: > I posted a link to the following on the HaskellTwo > wiki page. Please comment. > > I would like to suggest that PatternGuards NOT be included > in HaskellTwo. > > While I enjoyed Simon Peyton Jones' well-written > note on pattern g

[Haskell] No Pattern Guards

2005-03-28 Thread Yitzchak Gale
I posted a link to the following on the HaskellTwo wiki page. Please comment. I would like to suggest that PatternGuards NOT be included in HaskellTwo. While I enjoyed Simon Peyton Jones' well-written note on pattern guards [http://research.microsoft.com/Users/simonpj/Haskell/guards.html] very much

[Haskell] Superclass default methods

2005-03-28 Thread Yitzchak Gale
Thomas Hallgren wrote: If classes were allowed to declare default methods for superclasses... Benjamin Franksen wrote (on Haskell Libraries): Robert Will has written a fully specified proposal for this. He calls it "delayed method definition", see http://www.stud.tu-ilmenau.de/~robertw/dessy/fun/,