Commit 0ad9def5 authored by Simon Marlow's avatar Simon Marlow

#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.
parent 0af78f50
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment