Haskell 98 Report

Ross Paterson ross@soi.city.ac.uk
Wed, 30 May 2001 17:57:08 +0100


On Wed, May 30, 2001 at 09:46:53AM -0700, Simon Peyton-Jones wrote:
> | Sorry to get this comment in so late, but it is a small 
> | change. In the List module, the type signature for deleteBy 
> | is not as general as it could be, given the definition.  It 
> | could be generalized to the following (no change to the definition):
> | 
> |   deleteBy :: (a -> b -> Bool) -> a -> [b] -> [b]
> | 
> | I've found it usefully used at this more general type.
> 
> Indeed, and 
> 
>    deleteFirstsBy :: (a -> b -> Bool) -> [b] -> [a] -> [b]

and

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