[Haskell-cafe] Re: deleteBy type too restrictive
Christian Maeder
Christian.Maeder at dfki.de
Fri Jan 15 09:57:13 EST 2010
There's already a ticket for this proposal
http://hackage.haskell.org/trac/ghc/ticket/3399
Christian
Dan Rosén schrieb:
> 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.html#v:deleteBy
> http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/src/Data-List.html#deleteBy
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list