From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 38E8FBC2F for ; Fri, 26 Nov 2004 00:58:32 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAPNwVPp019104 for ; Fri, 26 Nov 2004 00:58:31 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA02029 for ; Fri, 26 Nov 2004 00:58:31 +0100 (MET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAPNwS1c016464 for ; Fri, 26 Nov 2004 00:58:30 +0100 Received: from [192.168.1.200] (ppp217-171.lns1.syd3.internode.on.net [203.122.217.171]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iAPNwOOU094588; Fri, 26 Nov 2004 10:28:26 +1030 (CST) Subject: Re: [Caml-list] What is an open type? From: skaller Reply-To: skaller@users.sourceforge.net To: Christophe TROESTLER Cc: caml-list In-Reply-To: <20041125.191933.88348027.debian00@tiscali.be> References: <1101398230.9291.53.camel@pelican.wigram> <20041125.191933.88348027.debian00@tiscali.be> Content-Type: text/plain Message-Id: <1101427104.9291.94.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 26 Nov 2004 10:58:24 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41A671A7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41A671A4.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 christophe:01 troestler:01 wrote:01 sourceforge:01 wrote:01 heap:01 subtyping:01 glebe:01 061:98 unbound:01 polymorphic:01 nsw:01 constraint:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Fri, 2004-11-26 at 05:19, Christophe TROESTLER wrote: > On 26 Nov 2004, skaller wrote: > > > > An open type like [> `X ] isn't actually a type, you can't > > name it like: > > > > type xx = [> `X ] > > It is polymorphic: > > type 'a xx = 'a constraint 'a = [> `X];; Wow! I didn't realise you could do that. This solves a heap of problems for me. Thanks! This looks (visualy) like 'a constraint >= [ `X ] i.e. a sneaky way of getting subtyping :) Pity this doesn't work: # type pm = 'b constraint 'b = [> ];; A type variable is unbound in this type declaration -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net