caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Vasilij Karpow <malc@boblycat.com>
To: caml-list@inria.fr
Subject: [Caml-list] Type inference problem
Date: Thu, 28 Jun 2001 17:23:48 +0200	[thread overview]
Message-ID: <20010628172348.A24964@boblycat.com> (raw)

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


             reply	other threads:[~2001-06-28 15:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-28 15:23 Vasilij Karpow [this message]
2001-06-28 15:40 ` Remi VANICAT
2001-06-28 19:08 ` Nils Goesche
2001-06-29  2:41 ` Jacques Garrigue
2005-11-01  7:58 Jonathan Roewen
2005-11-01  8:19 ` Jonathan Roewen
2005-11-01  8:50   ` skaller
2005-11-01  8:34 ` skaller
2005-11-01 16:21 ` Brian Hurt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010628172348.A24964@boblycat.com \
    --to=malc@boblycat.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).