[Haskell-cafe] Re: whine and solution about programmers not
respecting documentations
Christian Maeder
Christian.Maeder at dfki.de
Tue Jun 29 07:13:06 EDT 2010
Ketil Malde schrieb:
[...]
>>> I don't think there would be any doubt what 'deleteBy (<= 5) [1..10]'
>>> would do.
>> Well, if you don't know about filter, you could think it deletes all
>> elements satisfying the predicate, but apart from that, it's clear.
>
> I'd probably call it 'filter1', but that's just my personal convention.
I've called it 'deleteFirst' in
http://hackage.haskell.org/trac/ghc/ticket/3399
I would expect it to be more efficient than filter (with a negated
predicate), because no further comparisons are necessary once the
element to be deleted has been found.
C.
More information about the Haskell-Cafe
mailing list