On Sat, 2009-06-06 at 18:39 +0200, Bertram Felgenhauer wrote:
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 marlo...@gmail.com
| * #2528: reverse the order of args to (==) in nubBy to match
On Tue, 9 Jun 2009, Cale Gibbard wrote:
Similarly, groupBy f xs is (and should be) the unique list of
contiguous sublists of xs such that:
1) concat (groupBy f xs) = xs
2) If x is the head of any of the sublists and y is any other element
of that sublist, then f x y
3) The sequence of lengths
2009/6/6 Bertram Felgenhauer bertram.felgenha...@googlemail.com:
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 marlo...@gmail.com
| * #2528: reverse the order of args to (==) in nubBy to match
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
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