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 UAA06766; Thu, 15 Aug 2002 20:06:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 UAA06694 for ; Thu, 15 Aug 2002 20:06:02 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g7FI61v08136 for ; Thu, 15 Aug 2002 20:06:01 +0200 (MET DST) Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id UAA27377; Thu, 15 Aug 2002 20:05:52 +0200 Date: Thu, 15 Aug 2002 20:05:52 +0200 From: Markus Mottl To: Oleg Cc: Michael Hicks , caml-list@inria.fr Subject: Re: [Caml-list] Cyclic ?! Message-ID: <20020815180552.GB26027@fichte.ai.univie.ac.at> Mail-Followup-To: Oleg , Michael Hicks , caml-list@inria.fr References: <000301c24468$6cb5b350$6601a8c0@hicks> <200208151725.NAA12685@dewberry.cc.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200208151725.NAA12685@dewberry.cc.columbia.edu> User-Agent: Mutt/1.4i Organization: Austrian Research Institute for Artificial Intelligence Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 15 Aug 2002, Oleg wrote: > I'm not sure I understand you. If the two definitions are equivalent WRT > Empty <-> None & Node <-> Some name substitution, then the fact that the > compiler accepts one, but not the other must be a bug, yes? This is not a bug, because you can have the compiler typecheck it using the command-line flag "-rectypes". You'll certainly want to know now why this isn't standard behaviour. Type inference of recursive types is actually neither a theoretical problem nor an implementation difficulty (basically, I think, you just need to drop the occurs check during type unification - please correct me if I'm wrong). The problem rather is that programmers can accidently write down meaningless expressions for which the compiler infers absolutely crazy types. If I remember correctly, OCaml already had the more general rule by default in some ancient version, but the developers found that this generality caused more confusion than benefits to programmers... Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- 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