Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] Mixing variant types...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-01-13 (07:56)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Mixing variant types...
On Fri, 2006-01-13 at 13:57 +0900, Jacques Garrigue wrote:
> From: skaller <>
>> (* *)
>> type +'a event =
>>     Communication of 'a behavior
>>   | Choose of 'a event list
>>   | WrapAbort of 'a event * (unit -> unit)
>>   | Guard of (unit -> 'a event)

> The + above is not needed (it is implied by the definition)

But it would fail if the type is not in fact covariant
in its argument?

> You still need to coerce the resulting list:
> ( (fun w -> receive w.control) !windows :> ws_event list)

Still doesn't seem to work: OUCH! Yes it DOES. Argg..
I modified


but I didn't modify


So when I compile with -thread it doesn't work.
But when I compile with -vmthread it does work.
Which is pretty conclusive proof the patch does work
in at least one case. And if I'm right, the + in 
the implementation proves covariance mechanically so
it should be safe.

Should I add a feature request to the bug tracker?

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: