From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA06792; Thu, 13 May 2004 04:54:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA05385 for ; Thu, 13 May 2004 04:54:14 +0200 (MET DST) From: briand@aracnet.com Received: from citrine.spiritone.com (citrine.spiritone.com [216.99.193.133]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4D2sCSH028682 for ; Thu, 13 May 2004 04:54:13 +0200 Received: from soggy.deldotd.com (216-99-206-32.cust.aracnet.com [216.99.206.32]) by citrine.spiritone.com (8.12.10/8.12.8) with ESMTP id i4D2s8pD010459; Wed, 12 May 2004 19:54:09 -0700 Received: from briand by soggy.deldotd.com with local (Exim 3.36 #1 (Debian)) id 1BO6MI-0002GD-00; Wed, 12 May 2004 19:54:06 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16546.58189.824443.134275@soggy.deldotd.com> Date: Wed, 12 May 2004 19:54:05 -0700 To: Damien Cc: caml-list@inria.fr Subject: Re: [Caml-list] 'b is unbound In-Reply-To: <20040512134350.7be8c813.Damien.Pous@ens-lyon.fr> References: <16545.50388.591926.577605@soggy.deldotd.com> <20040512134350.7be8c813.Damien.Pous@ens-lyon.fr> X-Mailer: VM 6.92 under Emacs 21.2.1 X-Miltered: at concorde with ID 40A2E354.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 damien:01 damien:01 ens-lyon:01 inference:01 elt:01 mli:01 val:01 elt:01 bigarray:01 bigarray:01 writes:01 polymorphic:01 polymorphic:01 float:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "Damien" == Damien 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