2533: Generic functions that take integral arguments should work the same way as their prelude counterparts

Henning Thielemann lemming at henning-thielemann.de
Wed Aug 27 03:19:29 EDT 2008


On Tue, 26 Aug 2008, John Meacham wrote:

> But is also makes the functions less useful and another source of
> non-completeness. I certainly always considered accepting negative
> numbers a feature of those functions and not an infelicity.  Sometimes
> you want 'drop 1 xs' and other times you want 'tail xs' (or equivalent).

It's very confusing for readers of your programs, if you use 'drop 1' 
instead of 'tail'. The names 'drop' and 'tail' don't give the reader a 
hint, that 'drop' works for empty lists and 'tail' doesn't. 'drop 1' and 
'tail' should behave identically for empty lists and a function with 
different behaviour should have a different name.



More information about the Libraries mailing list