Re: Please apply the comparison function given to nubBy to elements of the list in the order in which they occur in the list.

2011-09-28 Thread Christian Maeder
In case you further want to discuss this, I've re-opened http://hackage.haskell.org/trac/ghc/ticket/2528#comment:10 So, I'm against your proposal, Cale, but suggest that you revert the order in your example (if you want to exploit this behavior). Cheers Christian Am 08.09.2011 02:07, schrieb

Re: Please apply the comparison function given to nubBy to elements of the list in the order in which they occur in the list.

2011-09-21 Thread Christian Maeder
Am 20.09.2011 20:21, schrieb Edward Kmett: [...] I would suggest you rephrase this as a formal proposal, then I can happily vote +1. Seeing the wonderful interrelation between elem, nub, nubBy and i.e. unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs intersectBy eq

Re: Please apply the comparison function given to nubBy to elements of the list in the order in which they occur in the list.

2011-09-20 Thread Christian Maeder
Looking at the code of nubBy http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.4.0.0/src/Data-List.html#nubBy nubBy :: (a - a - Bool) - [a] - [a] #ifdef USE_REPORT_PRELUDE nubBy eq [] = [] nubBy eq (x:xs) = x : nubBy eq (filter (\ y - not (eq x

Re: Please apply the comparison function given to nubBy to elements of the list in the order in which they occur in the list.

2011-09-20 Thread Malcolm Wallace
If this is a _proposal_ to change ghc's non-Report-compatible Data.List implementation to match the behaviour of the Report implementation, then count me as a +1. I think an important convention when it comes to higher order functions on lists is that to the extent which is possible, the

Re: Please apply the comparison function given to nubBy to elements of the list in the order in which they occur in the list.

2011-09-20 Thread Christian Maeder
Apologies for responding to myself, but the difference between the REPORT_PRELUDE and the ghc implementation also applies to elem and notElem. #ifdef USE_REPORT_PRELUDE elem x = any (== x) notElem x = all (/= x) #else elem _ [] = False elem x (y:ys) =