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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tmp123@m...
Subject: Re: [Caml-list] Sorted list
Philippe Wang wrote:

> skaller wrote:
>
>> On Sat, 2007-08-04 at 12:29 +0200, Philippe Wang wrote:
>>  
>>
>>> tmp123@menta.net wrote:
>>>    
>>
>>
>>  
>>
>>>> Of the standard modules, the most similar seems "set", because 
>>>> allows insertion and has the funcion "min_elt". However, the 
>>>> problem is, if two timers have the same time, addition of the 
>>>> second one removes the first.
>>>>
>>>>       
>>>
>>> Hello,
>>>
>>> Let's remind that Set.Make is a functor that takes a module with
>>> sig
>>>   type t
>>>   val compare : t -> t -> int
>>> end
>>>
>>> If you simply give him a compare function that never returns 0, then 
>>> you can add multiple elements that are the same.
>>>     
>>
>>
>> You cannot do that! compare function must be a total order.
>>   
>
> Why not ?
>
>

Hello,

Thanks for your help.

The problem with this option seems to be in the deletion of the set 
elements. It is not posible to use "Set.remove", because the compare 
function never returns "equal".

Kind regards.