From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 1C7CA7ED5C for ; Fri, 3 Aug 2012 08:09:06 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of lambda.q.q@gmail.com) identity=pra; client-ip=209.85.212.66; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of lambda.q.q@gmail.com designates 209.85.212.66 as permitted sender) identity=mailfrom; client-ip=209.85.212.66; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vb0-f66.google.com) identity=helo; client-ip=209.85.212.66; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="postmaster@mail-vb0-f66.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYHALdqG1DRVdRCW2dsb2JhbABFDrkQCBgXCAwHEwcjgiEBAQQSAhMZATgBAwwBBQUEBzsiEgEFAQgUBhMih1wDDJ5JCQOPFIVbJw2JSAEFDIs7hwQDiEeFKYdYjjA+gVSBcT4 X-IronPort-AV: E=Sophos;i="4.77,705,1336341600"; d="scan'208";a="152345075" Received: from mail-vb0-f66.google.com ([209.85.212.66]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Aug 2012 08:09:04 +0200 Received: by vbis24 with SMTP id s24so57072vbi.9 for ; Thu, 02 Aug 2012 23:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=1DZKOwdYDYQAPgwg32TylQLsOyy/nXEXacfL6x1B7+o=; b=hDo7k2s2Et8bQcn2prCHD/xRPX/0bxYndUlYBhooCzewNLY+2CCB6TUqRsWhn2QB4v 0fCe3lR47gC0eFAUitFntAIebp5J+bjza7KWEz4xErOWzFQlT8g0OAQfCh5cYaL+iQ5u 2LL/0AlpUMqq7UKlOCAuTibD/wG+DbUY2Ynt2afC+sQ9DTS3wy+QhF5pSYa9IPIYxr57 8o0DsUx18QrXRWCSIQeZ3mmNReLcuCYfN5rWsEY4JreqeM7A/NAm5n16mxi7Ys3rEWg6 m2xoOxTYuYE6wkWHuBFTaYyGXVDK4iqwH0G9SRQkNyqAMRtn90itIKbWYFkGrQuz50fk S04A== MIME-Version: 1.0 Received: by 10.58.4.232 with SMTP id n8mr441043ven.54.1343974143187; Thu, 02 Aug 2012 23:09:03 -0700 (PDT) Sender: lambda.q.q@gmail.com Received: by 10.58.218.35 with HTTP; Thu, 2 Aug 2012 23:09:03 -0700 (PDT) In-Reply-To: <60D24526-5521-4999-9894-5FDDBBA3B857@math.nagoya-u.ac.jp> References: <501B588B.6040006@frisch.fr> <60D24526-5521-4999-9894-5FDDBBA3B857@math.nagoya-u.ac.jp> Date: Fri, 3 Aug 2012 10:09:03 +0400 X-Google-Sender-Auth: xwNsNmK8wv6KFEoklP7S6iW-5-8 Message-ID: From: Ivan To: Jacques Garrigue Cc: Alain Frisch , caml-list Content-Type: multipart/alternative; boundary=047d7b66fcad645b8204c6565dcf Subject: Re: [Caml-list] type inference with classes --047d7b66fcad645b8204c6565dcf Content-Type: text/plain; charset=ISO-8859-1 On 3 August 2012 09:32, Jacques Garrigue wrote: > > Your assumption is wrong. A function never "requires" polymorphism from an > argument. > It may require a polymorphic method, but only if the type of this argument > is given explicitly. > Well, yes. I do not know what do you mean by saying "requiring polymorphism", but I do agree that my reasoning was wrong. Taking a simple example (without any classes): # let rec f x y = x y;; val f : ('a -> 'b) -> 'a -> 'b = I see, that function really requires as it's first argument any unary function. That is, from type scheme 'a -> 'b I can construct any type that contains one and only one arrow. And there is no subtype polymorphism involved here. Correct me if I'm wrong. The fact is that, at least in lablgtk-2.14.2 (the current version), the > type is > > expand_row : ?all:bool -> Gtk.tree_path -> unit > The first thing I've tried was specifying explicitly argument ~all. But compiler refused to accept this too, with exactly the same error message... --047d7b66fcad645b8204c6565dcf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On 3 August 2012 09:32, Jacqu= es Garrigue <garrigue@math.nagoya-u.ac.jp> wrote:=
Your assumption is wrong. A function never "requires" polymorphis= m from an argument.
It may require a polymorphic method, but only if the type of this argument = is given explicitly.

Well, yes. I do no= t know what do you mean by saying "requiring polymorphism", but I= do agree that my reasoning was wrong.
Taking a simple example (without any classes):

# let rec f x y =3D x y;;
val f : ('a -> 'b) -> &= #39;a -> 'b =3D <fun>

I see, that fun= ction really requires as it's first argument any unary function. That i= s, from type scheme 'a -> 'b I can construct any type that conta= ins one and only one arrow. And there is no subtype polymorphism =A0involve= d here. Correct me if I'm wrong.

The fact is that, at least in lablgtk-2.14.2 (the current version), the typ= e is

=A0 =A0 =A0 expand_row : ?all:bool -> Gtk.tree_path -> unit
The first thing I've tried was specifying explicitly argume= nt ~all. But compiler refused to accept this too, with exactly the same err= or message...



--047d7b66fcad645b8204c6565dcf--