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 JAA18769; Thu, 9 Aug 2001 09:28:26 +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 JAA18734 for ; Thu, 9 Aug 2001 09:28:25 +0200 (MET DST) Received: from margaux.inria.fr (margaux.inria.fr [128.93.8.2]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f797SPH15725 for ; Thu, 9 Aug 2001 09:28:25 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by margaux.inria.fr (8.7.6/8.7.3) with ESMTP id JAA10505 for ; Thu, 9 Aug 2001 09:28:25 +0200 (MET DST) Received: from mail.noos.fr (camus.noos.net [212.198.2.70]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f797SPH15721 for ; Thu, 9 Aug 2001 09:28:25 +0200 (MET DST) Message-Id: <200108090728.f797SPH15721@concorde.inria.fr> Received: (qmail 41790848 invoked by uid 0); 9 Aug 2001 07:28:21 -0000 Received: from unknown (HELO localhost) ([212.198.203.74]) (envelope-sender ) by 212.198.2.70 (qmail-ldap-1.03) with SMTP for ; 9 Aug 2001 07:28:21 -0000 Date: Thu, 9 Aug 2001 09:28:21 +0200 Content-Type: text/plain; format=flowed; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v388) From: =?iso-8859-1?Q?Laurent_Ch=E9no?= To: Caml-list X-Mailer: Apple Mail (2.388) Content-Transfer-Encoding: quoted-printable Subject: [Caml-list] False polymorphic Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk (please excuse my poor english) David said well : > # let id x =3D x;; > val id : 'a -> 'a =3D > > This expression is fully polymorphic. > > # let id2 =3D id id;; > val id2 : '_a -> '_a =3D > > This one is not (notice the underscore (_) before the type variable > a). It is a monomorphic type that is right know unknown but will be > determined at first instantiation. and you should read indeed > For further information on this subject, have a look at the FAQ: > = http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#variables_de_types_faibles > I just add this point : > #let id x =3D x ;; > id : 'a -> 'a =3D > #let id3 x =3D (id id) x ;; > id3 : 'a -> 'a =3D > #id3 ;; > - : 'a -> 'a =3D > #id3 3 ;; > - : int =3D 3 > #id3 "abc" ;; > - : string =3D "abc" > # > You can retain that this '_a problem can be avoided if you explicitly=20 give all expected args. Best regards, Laurent (who never learned english) -- Laurent Ch=E9no Prof. de math=E9matiques en PSI* et de l'option informatique en MP/MP* Lyc=E9e Louis-le-Grand, Paris http://pauillac.inria.fr/~cheno/ ------------------- 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