caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: briand@aracnet.com
To: Damien <Damien.Pous@ens-lyon.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] 'b is unbound
Date: Wed, 12 May 2004 19:54:05 -0700	[thread overview]
Message-ID: <16546.58189.824443.134275@soggy.deldotd.com> (raw)
In-Reply-To: <20040512134350.7be8c813.Damien.Pous@ens-lyon.fr>

>>>>> "Damien" == Damien  <Damien.Pous@ens-lyon.fr> writes:

  Damien> polymorphic methods require to be explicitly typed (this
  Damien> kind of type inference should lead to the one for system F)

After little more investigation I found that the following will work :

    method op (j:(float, Bigarray.float64_elt, Bigarray.c_layout) Bigarray.Array2.t) f x =

Seems very straightforward.  However there is one confusing aspect :

    method op (j:(float, Bigarray.float64, Bigarray.c_layout) Bigarray.Array2.t) f x =

   error -> Unbound type constructor Bigarray.float64

? Aha ! float64 in bigarray.mli is not a type but a val.

So now my method is no longer polymorphic, right ?


So everything makes sense until I go back to my bigarray test file :

   let a = Bigarray.Array2.create Bigarray.float64 Bigarray.c_layout n n;;

is OK.

   let a = Bigarray.Array2.create Bigarray.float64_elt Bigarray.c_layout n n;;

   error -> Unbound value Bigarray.float64_elt

Then I looked at the definition for create and it finally makes sense.

However I would argue that it is also _very_ confusing.

Why doesn't create simply take the type, i.e. ..._elt instead of 
('a, 'b) kind ??


Brian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2004-05-13  2:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-12  6:31 briand
2004-05-12 11:43 ` Damien
2004-05-12 19:11   ` briand
2004-05-13  2:54   ` briand [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=16546.58189.824443.134275@soggy.deldotd.com \
    --to=briand@aracnet.com \
    --cc=Damien.Pous@ens-lyon.fr \
    --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).