On 26-Jan-2000, Brian Boutel <[EMAIL PROTECTED]> wrote:
> On Wednesday, January 26, 2000 1:52 PM, Fergus Henderson 
> [SMTP:[EMAIL PROTECTED]] wrote:
> >
> > 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.
> 
> Sometimes things are just wrong, and they have to be fixed, however painful 
> that is.
> I would rather have a definition that makes sense, than one that has always 
> been wrong.
> 
> This case is not grossly wrong, but it is annoying. Taking and dropping 
> negative numbers of values
> does not make sense.

Sorry, I was probably not making myself clear.
In the discussion above, I was talking about making `take n l'
and `drop n l' report errors if n > length l.
That case is probably used quite widely by existing code,
and so I think changing it now would be a bad idea.

In contrast, I think the `take -1 []' case is the kind of thing
that is likely to be used only extremely rarely, if at all,
in existing code.  I would be happy to change that case to
be an error in H98.

> At the very least we have an inconsistancy in the treatment of negative 
> arguments, which should be fixed.

Agreed.

-- 
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