Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Sorting
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] Sorting
>From: "Marcin 'Qrczak' Kowalczyk" <qrczak@knm.org.pl>

>Sort.array : order:('a -> 'a -> bool) -> 'a array -> unit
>Sort.list  : order:('a -> 'a -> bool) -> 'a list -> 'a list

Old functions, obsolescent.

>Array.sort : cmp:('a -> 'a -> int) -> 'a array -> unit
>List.sort  : cmp:('a -> 'a -> int) -> 'a list -> 'a list

New functions.


>What are advantages and disadvantages in parametrizing either by '<'
>or by the 3-way comparison?

It's better because it is more modern :-)

Seriously, the 3-way comparison is more consistent with the
definition of Map.OrderedType.

-- Damien
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr