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 IAA05072; Mon, 17 Dec 2001 08:40:06 +0100 (MET) 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 IAA05338 for ; Mon, 17 Dec 2001 08:40:05 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBH7e4124190 for ; Mon, 17 Dec 2001 08:40:04 +0100 (MET) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA05311 for caml-list@inria.fr; Mon, 17 Dec 2001 08:40:04 +0100 (MET) Date: Mon, 17 Dec 2001 08:40:04 +0100 From: Francois Pottier To: caml-list@inria.fr Subject: Re: [Caml-list] Function call with a list of parameters Message-ID: <20011217084004.A4939@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <002e01c1836d$4ecfce00$0a53f2c3@Utilisateur> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: ; from frisch@clipper.ens.fr on Fri, Dec 14, 2001 at 02:26:38PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, Alain Frisch wrote: > Cyclic (aka recursive) types are necessary to type such an expression: > # fun x -> x # run (); x;; > - : (< run : unit -> 'b; .. > as 'a) -> 'a = This is slightly misleading. Such a type is really non-recursive, since it is an abbreviation for the following: < run : unit -> 'b; 'c > -> < run : unit -> 'b; 'c > The notation (t as 'a) allows sharing relationships to appear explicitly in print, yielding shorter and more readable types. It actually describes a recursive type only when 'a occurs within t, which is not the case in the example above. It happens e.g. when x is passed as a parameter to one of its own methods: # fun x -> x#compare(x);; - : (< compare : 'a -> 'b; .. > as 'a) -> 'b = -- François Pottier Francois.Pottier@inria.fr http://pauillac.inria.fr/~fpottier/ ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr