<p dir="ltr">Going with Henning's newDeleteBy would provide a better interface to deleting with an arbitrary predicate, and it would avoid the (unlikely?) chance of code breaking in the event that the more general type breaks some type inference.</p>
<br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 11, 2016, 9:19 AM Henning Thielemann <<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On Sun, 11 Sep 2016, Matthew Pickering wrote:<br>
<br>
> The type of `deleteBy` in `Data.List` could easily be generalised in a<br>
> useful way.<br>
><br>
> ```<br>
> deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]<br>
> ```<br>
<br>
I do not see why deleteBy should have an argument for the deleted element,<br>
anyway, since it is not even the element to delete (only an equivalent<br>
one). Wouldn't a function with type<br>
<br>
newDeleteBy :: (a -> Bool) -> [a] -> [a]<br>
<br>
be much more straight-forward?<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>