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.0 required=5.0 tests=AWL,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 EEC71BC6C for ; Tue, 31 Jul 2007 15:08:24 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6VD8N07003635 for ; Tue, 31 Jul 2007 15:08:24 +0200 Received: by wa-out-1112.google.com with SMTP id k17so2002608waf for ; Tue, 31 Jul 2007 06:08:22 -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:content-transfer-encoding:content-disposition:references; b=Wq8WLWWl3615NwmH1RuCbgCtVg4D+EOfCP4mWcYRO5hs8TLwgXhT+T3kPNe1FVjMF/ux/uGjrzdzbwlXUc6DUHIQWdyZzdmmck8iieg2yRVqlzCjEmZXSlMuRJQ4cB7Ei5Q+sCyjfz7EvL5Cf4rmpGvOEtNoeGnhCRMOt5uSu1Q= 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:content-transfer-encoding:content-disposition:references; b=qYYi68S9nfVeqJnV3QgAcbW582+BKXw0fJTuuUfadvReCnDf+khbIK8mzT47pi3vp/za6XHNo40gJ97L6lFzxzCgghFzFKJYnntEj6w/vTKnLXY0DtgDsNnADG+rIJmTazu0ovrnlilvivzo/EB4dv1K/jZSlID6biot/v7UjbM= Received: by 10.114.204.7 with SMTP id b7mr6672829wag.1185887302774; Tue, 31 Jul 2007 06:08:22 -0700 (PDT) Received: by 10.114.235.10 with HTTP; Tue, 31 Jul 2007 06:08:22 -0700 (PDT) Message-ID: <875c7e070707310608u760a6ea4mfe5c241019353d29@mail.gmail.com> Date: Tue, 31 Jul 2007 09:08:22 -0400 From: "Chris King" To: "Richard Jones" Subject: Re: [Caml-list] Re: Void type? Cc: "Brian Hurt" , caml-list@yquem.inria.fr In-Reply-To: <20070731085239.GA3217@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <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> <20070731085239.GA3217@furbychan.cocan.org> X-j-chkmail-Score: MSGID : 46AF3447.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46AF3447.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; foo:01 wrote:01 assert:01 assert:01 caml-list:01 int:01 int:01 variant:02 match:02 match:02 fuzzy:03 pattern:04 matching:05 chris:06 void:06 On 7/31/07, Richard Jones wrote: > The question is, which void type definition do you use? > > type void > > or > > type void = { v: 'a. 'a } Personally I would use the second. That way, when you come across a void value (say, in pattern matching a variant), you can take care of that match case without resorting to "assert false" (whether directly or via void_elim): type t = A of int | B of void match foo with | A i -> print_int i | B v -> v.v It makes me feel all warm & fuzzy inside that one doesn't have to resort to "assert false" here :)