
14 Jan
2010
14 Jan
'10
8:49 a.m.
Hello, 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 as well. Is there a particular reason that the type has this restriction? Otherwise, where can I post a suggestion to have it untightened? Best regards, Dan Rosén references: http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Data-List.htm... http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/src/Data-...