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 KAA15714; Mon, 25 Feb 2002 10:44:22 +0100 (MET) 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 KAA15801 for ; Mon, 25 Feb 2002 10:44:22 +0100 (MET) Received: from mail.cs.net.pl (cyber.cs.net.pl [62.233.142.98]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g1P9iIv09515 for ; Mon, 25 Feb 2002 10:44:19 +0100 (MET) Received: by mail.cs.net.pl (Postfix, from userid 510) id 7436C823; Mon, 25 Feb 2002 10:44:11 +0100 (CET) Date: Mon, 25 Feb 2002 10:44:11 +0100 From: Tomasz Zielonka To: Jacques Garrigue Cc: caml-list@inria.fr Subject: Re: [Caml-list] Narrowing coercions for functions with optional parameters Message-ID: <20020225094411.GA24739@cs.net.pl> References: <20020224140125.GA26745@cs.net.pl> <20020224183323.GB4757@cs.unibo.it> <20020224195028.GA11234@cs.net.pl> <20020225102930F.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020225102930F.garrigue@kurims.kyoto-u.ac.jp> User-Agent: Mutt/1.3.27i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Feb 25, 2002 at 10:29:30AM +0900, Jacques Garrigue wrote: > From: Tomasz Zielonka > > There is a common misunderstanding on the meaning of (e :> t). It > indeed allows some kind of coercion, but it does it by building a > generic subtype of t, which is then unified to the type of e. > [...] Thanks for explanation. > So the answer is: because implicit "coercions" work ok on some > specific syntactical cases, but cannot easily be generalized to full > coercions. > > So, you are stuck with (fun x -> g x), which is in fact shorter than > (g : ?add:int -> int -> int :> int -> int). No problem. PS. Labels in OCaml are great :) tom -- .-. Tomasz Zielonka CYBER SERVICE oo| programista http://www.cs.net.pl /`'\ zielony@cs.net.pl (\_;/) tel: [48] (22) 723-06-79 | tel/fax: [48] (22) 723-01-75 ------------------- 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