From: Simon Marlow Date: Tue, 2 Sep 2008 09:29:50 +0000 (+0000) Subject: #2528: reverse the order of args to (==) in nubBy to match nub X-Git-Url: http://git.megacz.com/?p=ghc-base.git;a=commitdiff_plain;h=0c5bf34eb6edcc423ba2e1f4e2eb27c059a1f8ef #2528: reverse the order of args to (==) in nubBy to match nub This only makes a difference when the (==) definition is not reflexive, but strictly speaking it does violate the report definition of nubBy, so we should fix it. --- diff --git a/Data/List.hs b/Data/List.hs index af6b3f5..aca5cac 100644 --- a/Data/List.hs +++ b/Data/List.hs @@ -342,7 +342,7 @@ nubBy eq l = nubBy' l [] -- 'y' is the potential new element elem_by :: (a -> a -> Bool) -> a -> [a] -> Bool elem_by _ _ [] = False -elem_by eq y (x:xs) = x `eq` y || elem_by eq y xs +elem_by eq y (x:xs) = y `eq` x || elem_by eq y xs #endif