From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id BDA86BC6D for ; Wed, 1 Aug 2007 13:37:20 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l71BbKPX013926 for ; Wed, 1 Aug 2007 13:37:20 +0200 Received: by ug-out-1314.google.com with SMTP id o2so182783uge for ; Wed, 01 Aug 2007 04:37:20 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=XIc4hUOZlzZS6fASi9K2xTek5fGrLe2fxxRhFwdqk9IxvmKvLui+QWKJSZaCej8fftcadD7O/76/pl44lbFdZfzfWpWjch0uIF8ttjFcYPmJ4O4EOUJbAjJ/2YXtslST29WAaAVCh7jpJmr7E5aGtnG9qiBO+/hw1L22JSOO7ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=GAAy6MqzLGjWFxkINHsjqakIIl9MTtUa6xOPd63dUlAWTJAq5KMC5hUVHlrQPLF0wh6cm6im/pFUn0xskVOVD4XRRqhCWIk1LaUyLz3cDJv2UiKySN2h00Gz7oPddBIKVjKL+7Bq3se73BoPO6ZZHI9J2JVvNGkPrz68BKAxKpQ= Received: by 10.78.157.19 with SMTP id f19mr146322hue.1185968239673; Wed, 01 Aug 2007 04:37:19 -0700 (PDT) Received: by 10.78.189.19 with HTTP; Wed, 1 Aug 2007 04:37:19 -0700 (PDT) Message-ID: Date: Wed, 1 Aug 2007 13:37:19 +0200 From: Tom To: "Brian Hurt" Subject: Re: [Caml-list] Re: Void type? Cc: caml-list@yquem.inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_39183_5130107.1185968239602" References: <46AC748B.10200@lix.polytechnique.fr> <200707291216.34682.jon@ffconsultancy.com> <46AC7BB8.8050609@gmail.com> <20070729124340.GA18564@furbychan.cocan.org> <46AC8EEF.1040102@gmail.com> <20070729170216.GA8137@furbychan.cocan.org> <46ACF35F.5070102@lix.polytechnique.fr> <1185770437.11618.29.camel@rosella.wigram> X-j-chkmail-Score: MSGID : 46B07070.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46B07070.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; struct:01 a's:01 struct:01 a's:01 W8:98 W8:98 wrote:01 wrote:01 abstract:01 abstract:01 typing:01 typing:01 caml-list:01 essentially:02 essentially:02 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_39183_5130107.1185968239602 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 31/07/07, Brian Hurt wrote: > > > So how do I use that module and say, in the type system, "I will never > pass in a b"? This is where the void type comes in. I can declare: > > module Myreq = struct > type a = whatever;; > type b = void;; > end;; > > module Myexample = Example(Myreq);; > > Note that I can still call function Myexample.foo- I can call it with an > empty list, or with a list of as many A's as I want. But it's impossible > for me to create a B element. > I am still not convinced about the usability of the void type... Why simply not declare type b as abstract? module Myreq = struct type a = whatever type b end Essentially, it means the same, just less typing. - Tom ------=_Part_39183_5130107.1185968239602 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 31/07/07, Brian Hurt <bhurt@spnz.org> wrote:

So how do I use that module and say, in the type system, "I will never
pass in a b"?  This is where the void type comes in.  I can declare:

module Myreq = struct
        type a = whatever;;
        type b = void;;
end;;

module Myexample = Example(Myreq);;

Note that I can still call function Myexample.foo- I can call it with an
empty list, or with a list of as many A's as I want.  But it's impossible
for me to create a B element.

I am still not convinced about the usability of the void type... Why simply not declare type b as abstract?

module Myreq = struct
        type a = whatever
        type b
end

Essentially, it means the same, just less typing.

 - Tom
------=_Part_39183_5130107.1185968239602--