From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA05781; Fri, 22 Oct 2004 09:43:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA05711 for ; Fri, 22 Oct 2004 09:43:23 +0200 (MET DST) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9M7hN32030345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Oct 2004 09:43:23 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay01.plus.net with esmtp (Exim) id 1CKu52-0008pw-8W for caml-list@inria.fr; Fri, 22 Oct 2004 07:43:20 +0000 From: Jon Harrop To: caml-list Subject: Re: [Caml-list] Polymorphism and the "for" loop Date: Fri, 22 Oct 2004 08:38:49 +0100 User-Agent: KMail/1.6.2 References: <1098425963.7584.9.camel@pelican.wigram> In-Reply-To: <1098425963.7584.9.camel@pelican.wigram> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200410220838.49340.jon@jdh30.plus.com> X-Miltered: at nez-perce with ID 4178BA1B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 bug:01 generalise:01 compilers:01 int:01 int:01 node:02 tree:02 tree:02 unit:03 unit:03 wrote:03 arguments:03 types:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday 22 October 2004 07:19, skaller wrote: > ...I consider that a bug... I'd have to go right ahead and disagree with you there. Surely a "procedure" returns no information, which can be achieved by returning the only value from a type representing a singleton set, i.e. _the_ value of the type unit. > type void = [] Why not "`void"? I've been wondering about this recently: how do the compilers store types which contain "unit". For example, if we have a tree: type 'a 'b tree = Leaf of 'a | Node of 'b * 'a 'b tree * 'a 'b tree Does a "unit unit tree" take up less space than a "int int tree"? The reason I'm asking is that it might be nice to generalise data structures as much as possible and then specialise them using "unit" arguments. Cheers, Jon. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners