module Device : sig type pull type push type pub type sub type router type dealer val streamer : pull Socket.t -> push Socket.t -> unit val forwarder : sub Socket.t -> pub Socket.t -> unit val queue : router Socket.t -> dealer Socket.t -> unit end On Mon, May 16, 2011 at 4:02 PM, Joel Reymont wrote: > > On May 16, 2011, at 3:39 PM, Gabriel Scherer wrote: > > > More generally, I don't think the polymorphic variants bring anything > more that what you could have with simple abstract types here. > > How would I accomplish this with simple abstract types? > > For example, how do I do this? > > module Device : > sig > > val streamer : [`Pull] Socket.t -> [`Push] Socket.t -> unit > val forwarder : [`Sub] Socket.t -> [`Pub] Socket.t -> unit > val queue : [`Router] Socket.t -> [`Dealer] Socket.t -> unit > > end > > -------------------------------------------------------------------------- > - for hire: mac osx device driver ninja, kernel extensions and usb drivers > ---------------------+------------+--------------------------------------- > http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont > ---------------------+------------+--------------------------------------- > > > >