From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 51D4ABB81 for ; Wed, 11 Jan 2006 11:36:56 +0100 (CET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0BAatkY009905 for ; Wed, 11 Jan 2006 11:36:56 +0100 Received: by wproxy.gmail.com with SMTP id i22so111528wra for ; Wed, 11 Jan 2006 02:36:54 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=oXap72vKs1uk69A/vmv9i075DaqdByuIn1dBSJ8QvOcP4l92og7b8kBGPbpkAXaqzRlOY2E29BONKzBEOHawzwl2baOAoQfj/prRM2LVG73OynkKQKtSYaM//FVlw/YR++MBPUX7f+lT3kxFlQczLsSg3F46rJhSUlVYsb5hDKU= Received: by 10.65.22.18 with SMTP id z18mr157174qbi; Wed, 11 Jan 2006 02:36:54 -0800 (PST) Received: by 10.65.22.19 with HTTP; Wed, 11 Jan 2006 02:36:54 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2006 23:36:54 +1300 From: Jonathan Roewen To: Christophe Dehlinger Subject: Re: [Caml-list] Mixing variant types... Cc: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 43C4DFC7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 coerced:01 expression:01 explicitly:01 variant:02 variant:02 hmm:02 types:02 let:03 let:03 channel:05 channel:05 mixing:07 fun:08 fun:08 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 > Hi, > > Have you tried explicitly casting event to an open variant type (or > whatever they're called) ? > > let sources =3D (Event.receive internal_control) :: List.map (fun w -> > Channel.receive (w.control :> 'a * [> event ]) !windows in Hmm, I tried that, and also: let sources =3D (Event.receive internal_control) :: List.map (fun w -> ((Channel.receive w.control) :> (window * [> event | `New_window ]) Event.event)) !windows in I now get: This expression cannot be coerced to type (window * ([> `New_window | `Repaint ] as 'a)) Event.event; it has type (window * event) Event.event but is here used with type (window * 'a) Event.event Type event =3D [ `Repaint ] is not compatible with type 'a The first variant type does not allow tag(s) `New_window Jonathan