logo       

Re: [ ghc-Bugs-643878 ] sortBy not stable: msg#00039

lang.haskell.glasgow.bugs

Subject: Re: [ ghc-Bugs-643878 ] sortBy not stable

In local.glasgow-haskell-bugs, you wrote:
> The library report requires that sortBy be stable. In
> 5.04.1 it isn't:

It looks like the change to mergesort broke this property:

#ifdef USE_REPORT_PRELUDE
sort = sortBy compare
sortBy cmp = foldr (insertBy cmp) []
#else

sortBy cmp l = mergesort cmp l
sort l = mergesort compare l

The #ifdef'ed definition is stable.
nhc98 has a stable mergesort, I'm told, so maybe we should ask
Malcolm nicely...
--
http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise