[Haskell-cafe] whine and solution about programmers not respecting documentations

Zura_ xyz at gol.ge
Tue Jun 29 04:47:40 EDT 2010


Maybe it is because deleteBy is defined wrongly? i.e. it is not logical,
doesn't follow the common sense user might expect. It accepts any predicate
but narrows requirements only in docs.

Maybe best could be to just take a value for comparison and use "==" against
it? ("overloaded" or "built-in" (I'm a C++ engineer but as I know it is
possible in Haskell as well.))

And to have separate delete which accepts arbitrary predicate. (As it is
now.)

Regards,
Zura


Albert Y. C. Lai wrote:
> 
> The doc of deleteBy states: "The deleteBy function behaves like delete,
> but
> takes a user-supplied equality predicate." A precondition is that the
> user-supplied predicate is an equality predicate. (>=) is not an equality
> predicate, be it in the layperson sense of "it isn't analogous to (==)" or
> the
> mathematical sense of "it isn't an equivalence relation".
> 

-- 
View this message in context: http://old.nabble.com/whine-and-solution-about-programmers-not-respecting-documentations-tp29017296p29021467.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list