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.3 required=5.0 tests=AWL 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 5C5FEBC6B for ; Sat, 28 Jul 2007 20:49:22 +0200 (CEST) Received: from tomts40-srv.bellnexxia.net (tomts40.bellnexxia.net [209.226.175.97]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6SInLZj004790 for ; Sat, 28 Jul 2007 20:49:21 +0200 Received: from pastel.home ([70.53.195.62]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070728184920.PGML29719.tomts40-srv.bellnexxia.net@pastel.home> for ; Sat, 28 Jul 2007 14:49:20 -0400 Received: by pastel.home (Postfix, from userid 20848) id 0016480DA; Sat, 28 Jul 2007 14:49:19 -0400 (EDT) Message-ID: To: "Chris King" Cc: caml-list@inria.fr Subject: Re: [Caml-list] Void type? References: <875c7e070707272151v2dc46c2ap3f7ed4ebd005726e@mail.gmail.com> From: Stefan Monnier Date: Sat, 28 Jul 2007 14:49:19 -0400 In-Reply-To: <875c7e070707272151v2dc46c2ap3f7ed4ebd005726e@mail.gmail.com> (Chris King's message of "Sat\, 28 Jul 2007 00\:51\:14 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde with ID 46AB8FB1.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 simulate:01 o'caml:01 abstract:01 caml-list:01 declaring:02 unit:03 trick:06 void:06 void:06 function:08 magic:10 obj:11 opposed:12 umontreal:13 >> Is there a void type in OCaml (i.e. a type which has no values), or a way to >> simulate it? > If you're looking for a "true" void (as opposed to the unit type, > which has exactly one value), just declaring it as an abstract type: > type void > should do the trick. You will be unable to instantiate any values of > that type using pure O'Caml (i.e. no Obj.magic or C code). But can I pass [] to a function that expects a "void list"? Stefan