Re: [Haskell-cafe] nubBy seems broken in recent GHCs

2009-06-10 Thread Duncan Coutts
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

Re: [Haskell-cafe] nubBy seems broken in recent GHCs

2009-06-10 Thread Henning Thielemann
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

Re: [Haskell-cafe] nubBy seems broken in recent GHCs

2009-06-09 Thread Cale Gibbard
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

Re: [Haskell-cafe] nubBy seems broken in recent GHCs

2009-06-06 Thread Bertram Felgenhauer
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

[Haskell-cafe] nubBy seems broken in recent GHCs

2009-06-05 Thread Cale Gibbard
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