Tue, 25 Jan 2000 15:33:25 -0800, Craig Dickson <[EMAIL PROTECTED]> pisze: > If "(x:xs)" does not match [], then the reason for this should be > that [] has no head to bind to x, nor tail to bind to xs; No, the reason is simply that [] and (:) are distinct constructors. E.g. the pattern Nothing does not match Just 5 even though there is no variable that can't be bound. Pattern matching must do what the semantics of the language requires. On the other hand, functions can be defined to do anything that is expressable. > "head []", "tail []", and "take 1 []" should also fail. If take would be spelled "take at most", it would certainly not be required to fail, right? But the name "take" is simpler and the only difference between the two is that take is defined on more values (with the "obvious" meaning), has no runtime penalties, so it suffices. -- __("< Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/ \__/ GCS/M d- s+:-- a22 C+++$ UL++>++++$ P+++ L++>++++$ E- ^^ W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t QRCZAK 5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-
- Re: drop & take [was: fixing typos ... Ch. A. Herrmann
- Re: drop & take [was: fixing typos in Haskel... Marcin 'Qrczak' Kowalczyk
- RE: drop & take [was: fixing typos in Haskel... Brian Boutel
- Re: drop & take [was: fixing typos in H... Craig Dickson
- Re: drop & take [was: fixing typos ... Craig Dickson
- Re: drop & take [was: fixing typos ... Fergus Henderson
- Re: drop & take [was: fixing typos in Haskel... Tom Pledger
- RE: drop & take [was: fixing typos in Haskel... Brian Boutel
- Re: drop & take [was: fixing typos in H... Fergus Henderson
- Re: drop & take [was: fixing typos in Haskel... Marcin 'Qrczak' Kowalczyk
- Re: drop & take [was: fixing typos in Haskel... Marcin 'Qrczak' Kowalczyk
- Re: drop & take [was: fixing typos in Haskel... Marcin 'Qrczak' Kowalczyk
- Re: drop & take [was: fixing typos in H... Pablo E. Martinez Lopez
- Specialisation by constraint [was: drop &am... Tom Pledger
- RE: drop & take [was: fixing typos in H... Frank A. Christoph
- Re: drop & take [was: fixing typos in H... Jan Kort
- RE: drop & take [was: fixing typos in Haskel... Brian Boutel
- RE: drop & take [was: fixing typos in H... Frank A. Christoph