
1 Oct
2016
1 Oct
'16
10:15 p.m.
On Sun, Sep 11, 2016 at 5:11 PM, Joachim Breitner
Hi,
Am Sonntag, den 11.09.2016, 11:25 +0100 schrieb Matthew Pickering:
deleteBy :: (a -> b -> Bool) -> a -> [b] -> [b]
-1 from me. This makes this different from the usual fooBy pattern, and the fact this this is possible points to some code smell, namely the lack of a
(a -> Bool) -> [a] -> [a]
function.
I agree. I'd much rather see the (a->Bool)->[a]->[a] function as the proper generalization of delete. As far as bikeshedding goes, something like "deleteFirst" would make it clearer how it differs from filter as well as avoiding issues with the fooBy naming convention (though I see there's a deleteFirstsBy which probably ruins our chances of using this name). -- Live well, ~wren