Generalise type of deleteBy
Henning Thielemann
lemming at henning-thielemann.de
Sun Sep 11 16:19:23 UTC 2016
On Sun, 11 Sep 2016, Matthew Pickering wrote:
> The type of `deleteBy` in `Data.List` could easily be generalised in a
> useful way.
>
> ```
> deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
> ```
I do not see why deleteBy should have an argument for the deleted element,
anyway, since it is not even the element to delete (only an equivalent
one). Wouldn't a function with type
newDeleteBy :: (a -> Bool) -> [a] -> [a]
be much more straight-forward?
More information about the Libraries
mailing list