Is not deleteBy :: (a->Bool) -> [a] -> [a]
more natural for the library than
deleteBy :: (a->a->Bool) -> a -> [a] -> [a]
?
For example, to remove the first negative from a list, people
suggest usually
deleteBy (< 0) [1,2,-1,3]
>
> Is not deleteBy :: (a->Bool) -> [a] -> [a]
> more natural for the library than
>deleteBy :: (a->a->Bool) -> a -> [a] -> [a]
> ?
I'd say so. In general the prelude seems rather weak on
functions to manipulate predicates.
Jón
--
Jón Fairbai
On Sun, 5 Dec 1999, S.D.Mechveliani wrote:
> Is not deleteBy :: (a->Bool) -> [a] -> [a]
> more natural for the library than
>deleteBy :: (a->a->Bool) -> a -> [a] -> [a]
> ?
isn't the first deleteBy simply filter?
-- m
Hello!
On Sun, Dec 05, 1999 at 05:53:33PM +, Jon Fairbairn wrote:
> > Is not deleteBy :: (a->Bool) -> [a] -> [a]
> > more natural for the library than
> >deleteBy :: (a->a->Bool) -> a -> [a] -> [a]
> > ?
> I'd say so. In general the prelude s
Sun, 5 Dec 1999 17:46:57 +0300 (MSK), S.D.Mechveliani <[EMAIL PROTECTED]> pisze:
> Is not deleteBy :: (a->Bool) -> [a] -> [a]
> more natural for the library than
>deleteBy :: (a->a->Bool) -> a -> [a] -> [a]
> ?
Possibly, but then IMHO it should not
No. A filter runs through the whole list, and delete(By) stops
after first occurence.
But there is another point. Some people say that such functions as
delete(By) are not only for the list constructor. Therefore any
suggestion has to take it in account other constructor case too.
I hardly can