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.4 required=5.0 tests=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 E34B8BC69 for ; Sun, 29 Jul 2007 13:36:27 +0200 (CEST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6TBaRUa031721 for ; Sun, 29 Jul 2007 13:36:27 +0200 Received: by nf-out-0910.google.com with SMTP id e27so104621nfd for ; Sun, 29 Jul 2007 04:36:26 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=awR21HK0aCAN5i0ctgZG6MfUUDr63gZj2he4DE1X59BnSyS9hAep+03uX4QwNwHjog9m+JIbRu8EU1BdY6qdOdp67YB7hTxs1jngHfV3LBoarm+YFvj9Krz1SnGHWeM1Ko0EgCo4AWNhRFFBaZmJQLyYVsGGJJUv+w3b5xSgw2c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=oO/YIYf0rLhV08yrE2nnSPOa978hG8dNmMwwas1OOeyJ2zyZOe71cFCRw5FfzbVhXDF8IuP4EGWHIq6N3mciK4ZJ8qR7tGohFZAS9R/df347OUXnblsaC+BidKPf6NlqrQsK5+nZRHMJkjfhhO+NS0IEZKlDa8lGsdF7m4h29C4= Received: by 10.86.89.4 with SMTP id m4mr3165798fgb.1185708986809; Sun, 29 Jul 2007 04:36:26 -0700 (PDT) Received: from ?192.168.0.2? ( [87.88.165.197]) by mx.google.com with ESMTPS id j9sm8654422mue.2007.07.29.04.36.25 (version=SSLv3 cipher=RC4-MD5); Sun, 29 Jul 2007 04:36:25 -0700 (PDT) Message-ID: <46AC7BB8.8050609@gmail.com> Date: Sun, 29 Jul 2007 13:36:24 +0200 From: Arnaud Spiwack User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: Void type? References: <46AC748B.10200@lix.polytechnique.fr> <200707291216.34682.jon@ffconsultancy.com> In-Reply-To: <200707291216.34682.jon@ffconsultancy.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-j-chkmail-Score: MSGID : 46AC7BBB.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46AC7BBB.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 syntax:01 ocaml:01 wrote:01 arnaud:01 arnaud:01 caml-list:01 exceptions:01 variant:02 variant:02 match:02 revised:02 revised:02 logical:04 matching:05 Jon Harrop a écrit : > On Sunday 29 July 2007 12:05:47 Arnaud Spiwack wrote: > >> It is the good solution if you work with the original syntax (and it's >> absolutely equivalent to the dual definition in term of empty variant >> which you can write in the revised syntax). >> > > I don't quite understand this "empty variant from the revised syntax thing". > How is: > > type void > > not an empty variant? > > Well, not technically I believe. It's a type with no definition. I wouldn't be adamant about that but I reckon it's not considered as a sum type by OCaml type system. Plus you cannot write the empty matching : match x with [] in the original syntax, preventing you from writing a function of type void -> 'a without using exceptions or Obj.magic or an obviously looping function or such. Thus it does not really have the logical behavior of an empty variant. Arnaud Spiwack