On 25-Jan-2000, Craig Dickson <[EMAIL PROTECTED]> wrote:
> Brian Boutel <[EMAIL PROTECTED]> wrote:
> 
> > We have seen various proposals about what laws should hold wrt
> > take and drop. I think there is a reasonable presumption that the
> > following  very simple laws should hold first:
> >
> > length (take n xs) === n
> > length (drop n xs) === length xs -n
> 
> Does that not imply that "take n xs" when n > (length xs) should be an
> error? I would support that for Haskell 2000, but not for Haskell 98; it's
> too big a change, and goes far beyond the original goal of resolving the
> problem of "take n xs | n < 0".

I agree that it is too big a change for Haskell 98.
But I think it would be too big a change for Haskell 2000 too.
Making a change like that could cause previously working programs
to fail, with no warning at compile time, and with the bug showing
up only on certain inputs.  The cost of that would far outweigh
the benefit (which, in the light of the mixed opinions here, seems
dubious anyway).  Making non-backwards-compatible changes to the
semantics of basic prelude functions like take and drop would be
a really bad idea, IMHO.

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.

Reply via email to