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 LAA16267; Tue, 2 Jul 2002 11:15:02 +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 LAA16240 for ; Tue, 2 Jul 2002 11:15:01 +0200 (MET DST) 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 g629ExP01141; Tue, 2 Jul 2002 11:14:59 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA16152; Tue, 2 Jul 2002 11:14:58 +0200 (MET DST) From: Pierre Weis Message-Id: <200207020914.LAA16152@pauillac.inria.fr> Subject: Re: [Caml-list] simple typing question In-Reply-To: <200207020414.g624EZf05386@orchestra.cs.caltech.edu> from Michael Vanier at "Jul 1, 102 09:14:35 pm" To: mvanier@cs.caltech.edu (Michael Vanier) Date: Tue, 2 Jul 2002 11:14:58 +0200 (MET DST) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > I imagine this has been asked and answered before, so I apologize in > advance. > > Compare these two functions: > > # let f x = List.map (fun y -> y) x ;; > val f : 'a list -> 'a list = > > and > > # let f = List.map (fun y -> y) ;; > val f : '_a list -> '_a list = > > Why does the second use the '_a type variable instead of 'a? I thought > that special type variables only had to do with polymorphic references. > The FAQ states that the latter expression can't be generalized, but I don't > really understand why. > > Mike This is explained in the FAQ of the language either in english http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-eng.html#polymorphisme ou en français: http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-fra.html#polymorphisme If you don't understand the explanations, please let me know. Cordialement, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- 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