Generalise type of deleteBy

Matthew Pickering matthewtpickering at gmail.com
Sun Sep 11 12:59:59 UTC 2016


I put a patch up on phab with the suggested changes. It also seemed
sensible to generalise deleteFirstsBy.

https://phabricator.haskell.org/D2526

Matt



On Sun, Sep 11, 2016 at 1:33 PM, Edward Kmett <ekmett at gmail.com> wrote:
> I have no objection.
>
> +1
>
> -Edward
>
> On Sun, Sep 11, 2016 at 6:28 AM, Michael Snoyman <michael at snoyman.com>
> wrote:
>>
>>
>> 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
>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>
>


More information about the Libraries mailing list