From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA12584 for caml-redistribution; Mon, 9 Feb 1998 13:50:08 +0100 (MET) 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 RAA26310 for ; Thu, 5 Feb 1998 17:05:37 +0100 (MET) Received: from krilin.dc.fi.udc.es (mail@krilin.dc.fi.udc.es [193.144.51.196]) by nez-perce.inria.fr (8.8.7/8.8.5) with SMTP id RAA13390 for ; Thu, 5 Feb 1998 17:05:34 +0100 (MET) Received: from quintela by krilin.dc.fi.udc.es with local (Exim 1.62 #1) id 0y0Tnn-0000Im-00 (Debian); Thu, 5 Feb 1998 17:05:23 +0100 To: Pierre CASTERAN Cc: caml-list@inria.fr Subject: Re: Weak types ? References: <199802031546.QAA21882@scrasmeustache.labri.u-bordeaux.fr> X-Url: http://www.dc.fi.udc.es/~quintela From: "Juan J. Quintela" Date: 05 Feb 1998 17:05:23 +0100 In-Reply-To: Pierre CASTERAN's message of Tue, 3 Feb 1998 16:46:22 +0100 (MET) Message-ID: Sender: weis Pierre CASTERAN wrote: > let toto = > let id x = x > in id id;; > (* > val toto : '_a -> '_a = > ^ ^ > > why not " 'a " ? > > *) Hi, I really dont remember the reason, but I remember one solution, to put explicity the varibles in the binbidng, i. e.: # let toto y = let id x = x in (id id) y;; val toto : 'a -> 'a = Now it works with the normal values: # toto 5;; - : int = 5 # toto true;; - : bool = true But the identity function returns again the extrange type variables: # toto (fun z -> z);; - : '_a -> '_a = You can solve this again using the same technique: # let f y = (toto (fun z -> z)) y;; val f : 'a -> 'a = I remember some mail (I think in this list) about this matter. It turs to be problem with the eta reduction but I don't remind the details, I remember the solution, to put the varibles in the bindings. I hope this helps. Cheers, Juan. PS. Someone knows the details for this behaviour?