Daniel Fischer <[email protected]> writes: >> 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.
> Unfortunately, you can't easily encode the requirement that it ought to be > an equivalence relation via types. This is just another way of saying the same thing :-) An important point of a powerful type system is to model your program so that only sensible code is legal. This makes me wonder why deleteBy is defined so loosely, instead of e.g. deleteBy :: (a -> Bool) -> [a] -> [a] I don't think there would be any doubt what 'deleteBy (<= 5) [1..10]' would do. And I just don't see what the requirement for an equivalence relation buys you. -k -- If I haven't seen further, it is by standing in the footprints of giants _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
