From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p4GE6cCK012383 for ; Mon, 16 May 2011 16:06:38 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgCAD4u0U3RVdy2kWdsb2JhbACYDoYxh08IFAEBAQEJCQ0HEieIcKFEjBqCNYReN4hiAQEDBoYTBJARiEuCOjuDNw X-IronPort-AV: E=Sophos;i="4.64,374,1301868000"; d="scan'208,217";a="108698034" Received: from mail-vx0-f182.google.com ([209.85.220.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 16 May 2011 16:06:33 +0200 Received: by vxc34 with SMTP id 34so6349349vxc.27 for ; Mon, 16 May 2011 07:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=2Mw7rjOY8b3kIYl+ANiDhEjaF/KdVpSQ7IEOfjj0RpA=; b=aU+kYR6SEddRNy2vSTUz23HUDKHNzV+ofPpLXfoFbtZEdH5e7Edqzx39tMpjvcYjrL oAu/Qen0H8aJsquuUPN6NZJxhy9kyxJLCrDVFgxtIWC3RYFfZiQwkBWULMjmp+nxmiBH 5eHlIer9eEJQSoT1iofQ2RR0FddcLlr2IxE9g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=YkTu84tCTxx27sR9aswC5pcxo3drLmn+76PnNtLVBuNxDDEx5RNDeOesq/aiYfm9B8 4Dhim6w/kn0rk6M6PhTpbM6hVrgqG5pQRtdonxbsLor2oTb/fMq93lnIMZVG2Unzg+QN QZ+3DvafONnpuEe202T1XghsZjiBfJWiLV+44= Received: by 10.52.98.34 with SMTP id ef2mr1178629vdb.293.1305554792076; Mon, 16 May 2011 07:06:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.183.136 with HTTP; Mon, 16 May 2011 07:06:12 -0700 (PDT) In-Reply-To: <4B14DFCC-03B8-49CD-87A6-844D23FAC53A@gmail.com> References: <87wrhr9n88.fsf@frosties.localnet> <522E096A-D3D5-466A-A445-AC5932F7B68F@gmail.com> <4B14DFCC-03B8-49CD-87A6-844D23FAC53A@gmail.com> From: Gabriel Scherer Date: Mon, 16 May 2011 16:06:12 +0200 Message-ID: To: Joel Reymont Cc: caml-list Content-Type: multipart/alternative; boundary=20cf307f35289dd67404a3652913 Subject: Re: [Caml-list] do i need a private row type? --20cf307f35289dd67404a3652913 Content-Type: text/plain; charset=ISO-8859-1 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 > ---------------------+------------+--------------------------------------- > > > > --20cf307f35289dd67404a3652913 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable mo= dule Device :=A0sig
=A0=A0type pull
=A0=A0type push
=A0=A0type pub
=A0=A0type sub
=A0=A0type router
=A0=A0type dealer
=A0=A0val streamer =A0: pull Socket.t -> push = Socket.t -> unit
=A0=A0val forwarder : sub Socket.t -> pub Socket.t = -> unit
=A0=A0val queue =A0 =A0 : router Socket.t -> dealer Socket.t -> unit<= /div>
end

On Mon, May 16, 2011 at 4:0= 2 PM, Joel Reymont <joelr1@gmail.com> wrote:

On May 16, 2011, at 3:39 PM, Gabriel Scherer wrote:

> More generally, I don't think the polymorp= hic variants bring anything more that what you could have with simple abstr= act types here.

How would I accomplish this with simple abstract types?

For example, how do I do this?

module Device :
sig

=A0val streamer =A0: [`Pull] Socket.t -> [`Push] Socket.t -> unit
=A0val forwarder : [`Sub] Socket.t -> [`Pub] Socket.t -> unit
=A0val queue =A0 =A0 : [`Router] Socket.t -> [`Dealer] Socket.t -> u= nit

end

-----------------------------------= ---------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers<= br> ---------------------+------------+---------------------------------------<= br> http://wagerlabs.com= | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------<= br>



--20cf307f35289dd67404a3652913--