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 RAA19605; Thu, 28 Jun 2001 17:22:56 +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 RAA19680 for ; Thu, 28 Jun 2001 17:22:55 +0200 (MET DST) Received: from yr ([195.159.42.21]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f5SFMsf27878 for ; Thu, 28 Jun 2001 17:22:55 +0200 (MET DST) Received: from malc by yr with local (Exim 3.22 #1 (Debian)) id 15Fde0-0006Uh-00 for ; Thu, 28 Jun 2001 17:23:48 +0200 Date: Thu, 28 Jun 2001 17:23:48 +0200 To: caml-list@inria.fr Subject: [Caml-list] Type inference problem Message-ID: <20010628172348.A24964@boblycat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.17i From: Vasilij Karpow Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Can anyone explain why O'Caml specializes the following: let simple ?fn list = let fn = match fn with | Some fn -> fn | None -> fun t -> t in let rec print = function | [] -> () | x :: xs -> print_endline (fn x); print xs in print list let _ = simple ["1"]; simple ~fn:(fun i -> string_of_int i) [1] to: val simple : ?fn:(string -> string) -> string list -> unit Thanks in advance. P.S. A bit offtopic. I suspect this mailing list is filled with skilled mathematicians (and just intelligent people), and since nobody i know was able to solve my problem, here it is: http://algol.prosalg.no/~malc/moo.ps [.dvi|.pdf|.tex] -- mailto:malc@pulsesoft.com ------------------- 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