[Haskell-cafe] deleteBy type too restrictive
danr at student.chalmers.se
Thu Jan 14 08:49:16 EST 2010
I realized today that the type for deleteBy in Data.List is too restrictive.
The code is:
deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
deleteBy _ _  = 
deleteBy eq x (y:ys) = if x `eq` y then ys else y : deleteBy eq x ys
though the type deleteBy :: (b -> a -> Bool) -> b -> [a] -> [a] will do good
Is there a particular reason that the type has this restriction? Otherwise,
where can I post a suggestion to have it untightened?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe