caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ivan <ivg@ieee.org>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: Alain Frisch <alain@frisch.fr>, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] type inference with classes
Date: Fri, 3 Aug 2012 10:09:03 +0400	[thread overview]
Message-ID: <CAL9dnAExgZ8xqzTeHsgamSE4A=Rb3a7RG_PoWAV0uh5KbjkmKQ@mail.gmail.com> (raw)
In-Reply-To: <60D24526-5521-4999-9894-5FDDBBA3B857@math.nagoya-u.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

On 3 August 2012 09:32, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>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 = <fun>

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...

[-- Attachment #2: Type: text/html, Size: 1672 bytes --]

  reply	other threads:[~2012-08-03  6:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  4:23 Ivan
2012-08-03  4:50 ` Alain Frisch
2012-08-03  5:15   ` Ivan
2012-08-03  5:32     ` Jacques Garrigue
2012-08-03  6:09       ` Ivan [this message]
2012-08-03 23:14 Jacques Garrigue

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='CAL9dnAExgZ8xqzTeHsgamSE4A=Rb3a7RG_PoWAV0uh5KbjkmKQ@mail.gmail.com' \
    --to=ivg@ieee.org \
    --cc=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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).