[m-dev.] For review: additions to array.m
Thomas Conway
conway at cs.mu.OZ.AU
Wed Feb 7 09:15:08 AEDT 2001
On Tue, Feb 06, 2001 at 08:07:46PM EST, Fergus Henderson wrote:
> > + % array__sort(Array) returns a version of Array sorted
> > + % into ascending order.
> > + %
> > +:- func array__sort(array(T)) = array(T).
> > +:- mode array__sort(array_di) = array_uo is det.
>
> You should document that this sort is not stable
> (and explain what "stable" means in this context).
If sort/2 uses compare/3 to compare records, then there is
no discernable difference between stable and unstable sorting.
Of course, you *can* tell the difference if you use a user
defined comparison pred or you use user-defined equality
types, but in the latter case, the sort might not work correctly
anyway.
--
Thomas Conway )O+
<conway at cs.mu.oz.au> 499 User error! Replace user, and press any key.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list