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 MAA04360; Sat, 17 Aug 2002 12:59:22 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA04324 for caml-list@pauillac.inria.fr; Sat, 17 Aug 2002 12:59:21 +0200 (MET DST) 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 QAA02367 for ; Thu, 15 Aug 2002 16:32:05 +0200 (MET DST) Received: from smtp.comcast.net (smtp.comcast.net [24.153.64.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7FEW4n02467 for ; Thu, 15 Aug 2002 16:32:05 +0200 (MET DST) Received: from hicks (pcp01311062pcs.nrockv01.md.comcast.net [68.50.232.145]) by mtaout01.icomcast.net (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 13 2002)) with ESMTP id <0H0W00K6M30644@mtaout01.icomcast.net> for caml-list@inria.fr; Thu, 15 Aug 2002 10:31:18 -0400 (EDT) Date: Thu, 15 Aug 2002 10:31:19 -0400 From: Michael Hicks Subject: RE: [Caml-list] Cyclic ?! In-reply-to: <200208150218.WAA22018@hickory.cc.columbia.edu> To: "'Oleg'" , caml-list@inria.fr Message-id: <000301c24468$6cb5b350$6601a8c0@hicks> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Mailer: Microsoft Outlook, Build 10.0.2627 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk If memory serves, ML datatypes elegantly overload about three distrinct type-theoretic constructs. In particular, the variant tags in the data type definition double as the "witnesses" to coercions between an iso-recursive type and its "unrolling" of one level. Without going into detail, this is why you can define something like type foo = Rec of foo;; but you can't define type foo = foo;; The latter definition is in the style of "equi-recursive" types, in which a recursive type is equivalent any number of its unrollings. This formulation is harder to typecheck, as I recall. There is a similar analogy between the two definitions of bin_tree that you present. Mike -----Original Message----- From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-list@pauillac.inria.fr] On Behalf Of Oleg Sent: Wednesday, August 14, 2002 10:20 PM To: caml-list@inria.fr Subject: [Caml-list] Cyclic ?! Hi I'm puzzled by the following compiler behavior: If I define bin_tree as type 'a bin_tree = Empty | Node of 'a bin_tree * 'a * 'a bin_tree the compiler accepts it. OTOH if I define it as type 'a bin_tree = ('a bin_tree * 'a * 'a bin_tree) option It gives an error: "The type abbreviation bin_tree is cyclic". Why??? And what's the difference between the two, really? Thanks Oleg ------------------- 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 ------------------- 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