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
[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: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: [Caml-list] Mixing variant types...

I'm wondering why the following doesn't work:

let sources = (Event.receive internal_control) :: (fun w ->
Channel.receive w.control) !windows in

where internal_control passes a (window,`New_window) event over the
channel, and w.control passes values of the type (window,event), where
type event = [ `Repaint ].

I thought that since they're both variant types, I should be able to
build a list that uses both variants.

Hmm, I just had a thought: is this because it's a tuple with the
variant inside the tuple?