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 OAA17398; Wed, 30 Jun 2004 14:21:19 +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 OAA17387 for ; Wed, 30 Jun 2004 14:21:17 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5UCLGSH007318 for ; Wed, 30 Jun 2004 14:21:17 +0200 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1Bfe5U-000280-00 for ; Wed, 30 Jun 2004 13:21:16 +0100 Date: Wed, 30 Jun 2004 13:21:16 +0100 To: caml-list@inria.fr Subject: [Caml-list] Re: Type unification problem Message-ID: <20040630122116.GA8170@redhat.com> References: <20040630121625.GA8099@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040630121625.GA8099@redhat.com> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 40E2B03C.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; unification:01 2004:99 dbi:99 dbi:99 ewp:99 unregister:01 unregister:01 hash:01 ltd:98 cmo:01 bool:01 bool:01 debug:01 debug:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jun 30, 2004 at 01:16:25PM +0100, rich wrote: > Why this error (below)? I can "fix" it by adding quite a lot of > explicit types (I need one on every function which uses the > Dbi.connection parameter). Is there a simpler way to fix it? [Sorry, there was an actual error in the last posting. This is the real error:] File "contact.ml", line 81, characters 25-28: This expression has type Apache.Request.t -> Cgi.cgi -> (< prepare_cached : string -> (< execute : Dbi.sql_t list -> unit; map : ([> `String of 'c ] list -> 'c) -> string list; .. > as 'b); .. > as 'a) -> int -> string -> 'd -> unit but is here used with type Apache.Request.t -> Cgi.cgi -> Dbi.connection -> int -> string -> Ewp.login_t -> unit Type 'a is not compatible with type Dbi.connection = < close : unit -> unit; closed : bool; commit : unit -> unit; database : string; database_type : string; debug : bool; ex : string -> Dbi.sql_t list -> Dbi.statement; host : string option; id : int; password : string option; ping : unit -> bool; port : string option; prepare : string -> Dbi.statement; prepare_cached : string -> Dbi.statement; register_postrollback : (unit -> unit) -> Dbi.postrollback_handle; register_precommit : (unit -> unit) -> Dbi.precommit_handle; rollback : unit -> unit; set_debug : bool -> unit; unregister_postrollback : Dbi.postrollback_handle -> unit; unregister_precommit : Dbi.precommit_handle -> unit; user : string option > Type 'b is not compatible with type Dbi.statement = < connection : Dbi.connection; execute : Dbi.sql_t list -> unit; fetch1 : unit -> Dbi.sql_t list; fetch1hash : unit -> (string * Dbi.sql_t) list; fetch1int : unit -> int; fetch1string : unit -> string; fetchall : unit -> Dbi.sql_t list list; finish : unit -> unit; fold_left : 'e. ('e -> Dbi.sql_t list -> 'e) -> 'e -> 'e; fold_right : 'f. (Dbi.sql_t list -> 'f -> 'f) -> 'f -> 'f; iter : (Dbi.sql_t list -> unit) -> unit; map : 'g. (Dbi.sql_t list -> 'g) -> 'g list; names : string list; serial : string -> int > make: *** [contact.cmo] Error 2 -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment Learning Objective CAML for C, C++, Perl and Java programmers: http://www.merjis.com/richj/computers/ocaml/tutorial/ ------------------- 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