deleteBy type

1999-12-05 Thread S.D.Mechveliani
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]

Re: deleteBy type

1999-12-05 Thread Jon Fairbairn
> > 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

Re: deleteBy type

1999-12-05 Thread Mariano Suarez Alvarez
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

Re: deleteBy type

1999-12-05 Thread Hannah Schroeter
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

Re: deleteBy type

1999-12-05 Thread Marcin 'Qrczak' Kowalczyk
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

Re: deleteBy type

1999-12-07 Thread S.D.Mechveliani
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