
Cale Gibbard wrote:
According to the Report:
nubBy :: (a -> a -> Bool) -> [a] -> [a] nubBy eq [] = [] nubBy eq (x:xs) = x : nubBy eq (filter (\y -> not (eq x y)) xs)
Hence, we should have that
nubBy (<) (1:2:[]) = 1 : nubBy (<) (filter (\y -> not (1 < y)) (2:[])) = 1 : nubBy (<) [] = 1 : []
However in ghc-6.10.3:
Prelude Data.List> nubBy (<) [1,2] [1,2]
Interesting. This was changed in response to
http://hackage.haskell.org/trac/ghc/ticket/2528
| Tue Sep 2 11:29:50 CEST 2008 Simon Marlow