From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 6E5BFBC37 for ; Sun, 3 Jan 2010 01:30:22 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.47,490,1257116400"; d="scan'208";a="40901016" Received: from mail-ew0-f226.google.com ([209.85.219.226]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/RC4-MD5; 03 Jan 2010 01:30:22 +0100 Received: by ewy26 with SMTP id 26so11979771ewy.3 for ; Sat, 02 Jan 2010 16:30:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.63.75 with SMTP id a11mr2742659ebi.63.1262478621672; Sat, 02 Jan 2010 16:30:21 -0800 (PST) In-Reply-To: <7d8707de1001020846s29332a67j21878751ed3da22@mail.gmail.com> References: <7d8707de1001020846s29332a67j21878751ed3da22@mail.gmail.com> Date: Sun, 3 Jan 2010 01:30:21 +0100 Message-ID: Subject: Re: [Caml-list] Re: value restriction From: Kaustuv Chaudhuri To: caml-list caml-list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; andrej:01 andrej:01 val:01 stdin:01 vars:01 val:01 expansive:01 ocaml:01 2009:98 liberal:98 04.:98 sml:01 sml:01 polymorphic:01 wrote:01 On Sat, Jan 2, 2010 at 5:46 PM, Andrej Bauer wrot= e: > It's even worse: > =C2=A0 =C2=A0 =C2=A0 =C2=A0Objective Caml version 3.11.1 > # let _ =3D ref () in fun x -> x ;; > - : '_a -> '_a =3D > I am sure this makes sense in France. I'm not sure why you're singling out France. % sml Standard ML of New Jersey v110.69 [built: Sun Jun 7 19:18:24 2009] - let val _ =3D ref () in fn x =3D> x end ; stdIn:1.1-1.36 Warning: type vars not generalized because of value restriction are instantiated to dummy types (X1,X2,...) val it =3D fn : ?.X1 -> ?.X1 This shouldn't be surprising: a let form is "expansive" and therefore cannot have a polymorphic type. OCaml is much more liberal than SML about what forms it considers "non-expansive" [1]. -- Kaustuv [1] http://caml.inria.fr/pub/papers/garrigue-value_restriction-fiwflp04.pdf