The problem with this solution, if I understand it correctly, is that it amounts to losing type information. Your values begin with some type information attached to them, that allows more fine-grained typing of some information (subscription), but then you coerce them into a big magma of "everything" to put them in the array, and the type information is lost. When you get back an element of this array, you don't know anymore if it was a `Pair or a `Sub for example. You probably won't be able to use the more restrictive operations of your interface. A solution to this problem would be to tag each item with its provenance type, so that you can regain fine-grained types dynamically : type any_poll = | Pair of pair poll | Sub of sub poll | ... Then, given an array of `any_poll` elements, you can pattern match and, if it's a `Sub`, you have a `sub poll` available. I think this is more precise than your current solution. More generally, I don't think the polymorphic variants bring anything more that what you could have with simple abstract types here. For example to coerce everything to a common type with the `pair poll`, `sub poll` solution you could define a `any` abstract datatype and provide a `val lose_type_info : 'a poll -> any poll` function. Unless I'm mistaken, this is equivalent to your current solution, and shields you of any superfluous polymorphic variant oddities. On Mon, May 16, 2011 at 3:02 PM, Joel Reymont wrote: > Issue solved thanks to Anil Madhavapeddy. > > val pair : [>`Pair] kind > val pub : [>`Pub] kind > > etc. > > and then > > type poll_socket = [`Pair|`Pub|`Sub|`Req|`Rep|`Dealer|`Router|`Pull|`Push] > Socket.t > type poll_item = (poll_socket * event_mask) > > val of_poll_items : poll_item array -> t > > This does it! > > -------------------------------------------------------------------------- > - for hire: mac osx device driver ninja, kernel extensions and usb drivers > ---------------------+------------+--------------------------------------- > http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont > ---------------------+------------+--------------------------------------- > > > >