Can we stop polluting the namespace with list based function
definitions?  Most of these functions: delBy, filter, map, concat, length,
take, takeWhile, etc. are well specified for data structures other than
lists.  Regardless of whether Haskell includes generic programming
extensions, it would be nice to be able to use these function names for
the same operation in other datastructures (even if they are implemented
manually). 

-Alex-

On Tue, 7 Dec 1999, S.D.Mechveliani wrote:

> To my proposal to add to  Haskell-2  library
>                                  delBy :: (a -> Bool) -> [a] -> [a]
> 
> Keith Wansbrough <[EMAIL PROTECTED]>  
> writes on 06 Dec 1999 
> 
> > So what do you propose as the definition for
> > 
> > del :: (Eq a) => [a] -> [a]
> >
> > ?
> > 
> > Section 7.6 of the Library Report:
> >
> > "By convention, overloaded functions have a non-overloaded 
> > counterpart whose name is suffixed with ``By''."
> 
> 
> Does this really imply that having  delBy,  the library has 
> necessarily to include `del' ?
> Anyway, let us try to improve the proposal:
> -------------------------------------------------------------------
> (1) To change in the `List' library the  deleteBy  definition to
> 
>   deleteBy :: (a -> Bool) -> [a] -> [a]
>   deleteBy _ []     = []
>   deleteBy p (a:as) = if  p a  then  as  else  a:(deleteBy p as) 
> 
> deleteBy  of Haskell-98  to rename to  
> delByR2e  (delete by binary relation (a->a->Bool) and element a).
> 
> - or better to remove it at all. For its type looks esoteric.
> I wonder, who ever uses it.
> 
> (2) To change in the Section 7.6 of the Library Report
>   "
>   By convention, overloaded functions have a non-overloaded 
>   counterpart whose name is suffixed with ``By''.
>   "
> to
>   "
>   By convention, an overloaded function may have several 
>   non-overloaded counterparts whose names are suffixed with 
>   `By'[ss].
>   Examples:  By     means "by something simplest",
>              ByP    by predicate,
>              ByR2   by binary relation,
>              ...
>   "
> ---------------------------------------------------------------------
> 
> 
> ------------------
> Sergey Mechveliani
> [EMAIL PROTECTED]
> 
> 
> 

___________________________________________________________________
S. Alexander Jacobson                   Shop.Com
1-212-697-0184 voice                    The Easiest Way To Shop

Reply via email to