The ____By functions in the 1.3 PreludeList (elemBy, deleteBy, etc.)
all take ``equality'' predicates with type a -> a -> Bool.  Most of
these functions (with no change in definition that I see in a quick
check) could take predicates with type a -> b > Bool (with a
corresponding change in the type of the other arguments).  For
example, I find myself wanting to use
  elemBy :: (a -> b -> Bool) -> a -> [b] -> Bool
  elemBy = any (eq x)   
while the draft prelude has
  elemBy :: (a -> a -> Bool) -> a -> [a] -> Bool
  elemBy = any (eq x)   

The one downside that I can see (I've not thought about this long) of
such a generalization is a few problems (caught during type-checking)
when one forgets which predicate argument comes from the key and which
>from the list.  What are the others?

                mike gunter




Reply via email to