caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Olivier Andrieu <oandrieu@nerim.net>
To: Ivan <ivg@ieee.org>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] passing object to a function fails to compile (lablgtk2 involved)
Date: Wed, 18 Jul 2012 18:53:45 +0200	[thread overview]
Message-ID: <CAD5gH1H_ZELqQ1QgaZ+QKCjjoFXXZf_JG_Ui=J357Hbf+nkseg@mail.gmail.com> (raw)
In-Reply-To: <587471342513938@web8h.yandex.ru>

On Tue, Jul 17, 2012 at 10:32 AM, Ivan <ivg@ieee.org> wrote:
> Method set (which I'm suspecting as a cause of a failure) has type, that contains type quantifier:
> "'a. row:Gtk.tree_iter -> column:'a column -> 'a -> unit". Right now, type quantifiers are out of my ocaml's
> active vocabulary. In other words I do not know, how to handle them properly.

Yes, the GTree.list_store has a polymorphic method #set. Such methods
usually need a type annotation otherwise
the type inference will give you a regular non-polymorphic type for the method.

In your case the simple solution would be to constrain your model argument :
    let fill_model (model : GTree.list_store) name_col value_col =

(not tested :)

> Moreover, I still have no insight on the variable 'b. Why do the compiler refers to some 'b, without even mentioning it in the types it inferred? It's very strange for me.

This 'b variable is hidden in GTree.list_store I think.
A class name such as GTree.list_store acts like an alias for the
corresponding object type, here something like < ... set : 'b.
row:Gtk.tree_iter -> column:'b  GTree.column-> 'b -> unit ... >.

-- 
  Olivier

      reply	other threads:[~2012-07-18 16:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-16  6:49 Ivan
2012-07-16 15:29 ` Anthony Tavener
2012-07-17  8:32   ` Ivan
2012-07-18 16:53     ` Olivier Andrieu [this message]

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='CAD5gH1H_ZELqQ1QgaZ+QKCjjoFXXZf_JG_Ui=J357Hbf+nkseg@mail.gmail.com' \
    --to=oandrieu@nerim.net \
    --cc=caml-list@inria.fr \
    --cc=ivg@ieee.org \
    /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).