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
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
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
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
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) =