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=0.4 required=5.0 tests=AWL,NO_REAL_NAME autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 2FFADBC6B for ; Sat, 28 Jul 2007 10:22:10 +0200 (CEST) Received: from triton.rz.uni-saarland.de (triton.rz.uni-saarland.de [134.96.7.25]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6S8M9kQ002567 for ; Sat, 28 Jul 2007 10:22:09 +0200 Received: from uni-sb.de (uni-sb.de [134.96.7.230]) by triton.rz.uni-saarland.de (8.12.11.20060614/8.12.10) with ESMTP id l6S8M5PZ23812300 for ; Sat, 28 Jul 2007 10:22:06 +0200 (CEST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by uni-sb.de (8.14.1/2007040500) with ESMTP id l6S8M5g1011204 for ; Sat, 28 Jul 2007 10:22:05 +0200 (CEST) Received: from mail.ps.uni-sb.de (james.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.14.1/2007062800) with ESMTP id l6S8M5Fn003397 for ; Sat, 28 Jul 2007 10:22:05 +0200 (CEST) Received: from localhost ([127.0.0.1] helo=www.ps.uni-sb.de ident=www-data) by mail.ps.uni-sb.de with esmtp (Exim 4.63) (envelope-from ) id 1IEhYr-0006r9-7Z for caml-list@inria.fr; Sat, 28 Jul 2007 10:22:05 +0200 Received: from 84.165.172.53 (SquirrelMail authenticated user rossberg) by www.ps.uni-sb.de with HTTP; Sat, 28 Jul 2007 10:22:05 +0200 (CEST) Message-ID: <61777.84.165.172.53.1185610925.squirrel@www.ps.uni-sb.de> In-Reply-To: <6h3rn4-uu7.ln1@mantle.rutgers.edu> References: <6h3rn4-uu7.ln1@mantle.rutgers.edu> Date: Sat, 28 Jul 2007 10:22:05 +0200 (CEST) Subject: Re: [Caml-list] Re: Void type? From: rossberg@ps.uni-sb.de To: caml-list@inria.fr User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: rossberg@ps.uni-sb.de X-SA-Exim-Scanned: No (on mail.ps.uni-sb.de); SAEximRunCond expanded to false X-DCC-INFN-TO-Metrics: de; whitelist X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (triton.rz.uni-saarland.de [134.96.7.25]); Sat, 28 Jul 2007 10:22:06 +0200 (CEST) X-AntiVirus: checked by AntiVir MailGate (version: 2.1.2-14; AVE: 7.4.0.50; VDF: 6.39.0.193; host: AntiVir0) X-Miltered: at concorde with ID 46AAFCB1.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; rossberg:01 gmane:01 gmane:01 ocaml:01 simulate:01 ocaml's:01 variants:01 iirc:01 polymorphic:01 wrote:01 wrote:01 abstract:01 rec:01 rec:01 defines:01 Chung-chieh Shan wrote: > Stefan Monnier wrote in article > in > gmane.comp.lang.caml.inria: >> Is there a void type in OCaml (i.e. a type which has no values), or a >> way to >> simulate it? > > type void = Void of void Dont't forget OCaml's let-rec: let rec v = Void v works like a charm. Sébastian Hinderer wrote: > What about > type void = { v : void };; Same here: let rec v = {v = v} Since there are no empty polymorphic variants either (there used to be in earlier versions, IIRC), the only solution is: Chris Kings wrote: > type void This is a *declaration*, and as such defines a new abstract type that is uninhabited, as desired. - Andreas