Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jonathan Roewen <jonathan.roewen@gmail.com>
To: Christophe Dehlinger <christophe.dehlinger@ifp.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Mixing variant types...
Date: Wed, 11 Jan 2006 23:36:54 +1300	[thread overview]
Message-ID: <ad8cfe7e0601110236r6e12fcc0pa30d958ba579c3f@mail.gmail.com> (raw)

> Hi,
>
> Have you tried explicitly casting event to an open variant type (or
> whatever they're called) ?
>
> let sources = (Event.receive internal_control) :: List.map (fun w ->
> Channel.receive (w.control :> 'a * [> event ]) !windows in

Hmm, I tried that, and also:

let sources = (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 = [ `Repaint ] is not compatible with type 'a
The first variant type does not allow tag(s) `New_window

Jonathan


             reply	other threads:[~2006-01-11 10:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-11 10:36 Jonathan Roewen [this message]
2006-01-12  1:24 ` Jonathan Roewen
2006-01-12  2:45   ` skaller
2006-01-12  3:22   ` Jacques Garrigue
2006-01-12  3:57     ` skaller
2006-01-13  4:57       ` Jacques Garrigue
2006-01-13  7:56         ` skaller
2006-01-13  9:37           ` Jacques Garrigue
2006-01-12  3:59     ` Jonathan Roewen
  -- strict thread matches above, loose matches on Subject: below --
2006-01-11  9:56 Jonathan Roewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad8cfe7e0601110236r6e12fcc0pa30d958ba579c3f@mail.gmail.com \
    --to=jonathan.roewen@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=christophe.dehlinger@ifp.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox