Generalise type of deleteBy

Michael Snoyman michael at snoyman.com
Sun Sep 11 10:28:57 UTC 2016


On Sun, Sep 11, 2016 at 1:25 PM, Matthew Pickering <
matthewtpickering at gmail.com> wrote:

> The type of `deleteBy` in `Data.List` could easily be generalised in a
> useful way.
>
> ```
> deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
> ```
>
> to
>
> ```
> deleteBy :: (a -> b -> Bool) -> a -> [b] -> [b]
> ```
>
> There is this closed ticket but no reasons for not generalising.
>
> https://ghc.haskell.org/trac/ghc/ticket/3399
>
> Discussion Period: 1 week.
>
> Matt
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>

+1, seems straightforward. My only concern: does anyone have real life
examples of code where this generalization would lead to type inference
problems? I can't think of anything offhand.

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160911/60105947/attachment.html>


More information about the Libraries mailing list