Haskell 98 Report

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Wed, 30 May 2001 18:37:47 +0100


> > | It could be generalized to the following (no change to the definition):
> > | 
> > |   deleteBy :: (a -> b -> Bool) -> a -> [b] -> [b]
> > 
> > Indeed, and 
> > 
> >    deleteFirstsBy :: (a -> b -> Bool) -> [b] -> [a] -> [b]
> 
> and
>      intersectBy :: (a -> b -> Bool) -> [a] -> [b] -> [a]

Although curiously, its dual 'unionBy' cannot also take the more
general type

        unionBy :: (a -> b -> Bool) -> [a] -> [b] -> [a]

at least, not with its current specification in terms of 'nubBy'.

Regards,
    Malcolm