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 BAA06150; Wed, 7 Jul 2004 01:24:53 +0200 (MET DST) 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 BAA06081 for ; Wed, 7 Jul 2004 01:24:52 +0200 (MET DST) Received: from web53206.mail.yahoo.com (web53206.mail.yahoo.com [206.190.39.222]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i66NOpEV008931 for ; Wed, 7 Jul 2004 01:24:51 +0200 Message-ID: <20040706232450.39587.qmail@web53206.mail.yahoo.com> Received: from [155.99.182.148] by web53206.mail.yahoo.com via HTTP; Tue, 06 Jul 2004 16:24:50 PDT Date: Tue, 6 Jul 2004 16:24:50 -0700 (PDT) From: Andy Yang Subject: [Caml-list] Why type infenere enter infinte loop here? To: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at nez-perce with ID 40EB34C3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; val:01 val:01 promotions:99 ocaml:01 ocaml:01 int:01 int:01 rec:01 trivial:01 let:04 let:04 providers:94 yang:06 loop:06 type:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, all I am relatively new in Ocaml. Perhaps this problem is trivial. With the following interactive process, ocaml cannot give out f2's type. Could you tell me why it cannot? # let rec y f = f (fun x ->(y f) x);; val y : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b = # let g h x = h x;; val g : ('a -> 'b) -> 'a -> 'b = # let f1 = y g;; val f1 : '_a -> 'b = # let k x = x * x + 1;; val k : int -> int = # let f2 = f1 k;; Thanks a lot! Andy __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail ------------------- 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