From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 3AC8A7ED93 for ; Mon, 1 Oct 2012 00:04:35 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of pierre.chopin@u-psud.fr) identity=pra; client-ip=129.175.33.42; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierre.chopin@u-psud.fr"; x-sender="pierre.chopin@u-psud.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of pierre.chopin@u-psud.fr) identity=mailfrom; client-ip=129.175.33.42; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierre.chopin@u-psud.fr"; x-sender="pierre.chopin@u-psud.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp2.u-psud.fr) identity=helo; client-ip=129.175.33.42; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierre.chopin@u-psud.fr"; x-sender="postmaster@smtp2.u-psud.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsCACrBaFCBryEqiWdsb2JhbABFvSkDgQojAQEBFRIUBSKCIiwLASuBTYgkmGOgNYt8gk6DIAOIWIURiRWSHQ X-IronPort-AV: E=Sophos;i="4.80,514,1344204000"; d="scan'208";a="157379658" Received: from smtp2.u-psud.fr ([129.175.33.42]) by mail4-smtp-sop.national.inria.fr with ESMTP; 01 Oct 2012 00:04:34 +0200 Received: from smtp2.u-psud.fr (localhost [127.0.0.1]) by localhost (MTA) with SMTP id 735B4348B08 for ; Mon, 1 Oct 2012 00:04:34 +0200 (CEST) Received: from webmail.u-psud.fr (webmail2.u-psud.fr [129.175.33.52]) by smtp2.u-psud.fr (MTA) with ESMTP id 4026C348B22 for ; Mon, 1 Oct 2012 00:04:34 +0200 (CEST) X-Squirrel-UserHash: IxgQGwAXSw8jTCMYGw== X-Squirrel-FromHash: a0AUD0BDVg8= Message-ID: <64d7146993183dc67fd675e7eb6f710f.squirrel@webmail.u-psud.fr> Date: Sun, 30 Sep 2012 15:04:34 -0700 From: "Pierre Chopin" To: caml-list@inria.fr User-Agent: SquirrelMail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [Caml-list] pgocaml and lwt Hi, I am trying to use pgocaml and lwt, but I have some error I can't understand: (**********************************************) (**********************************************) module Thread = struct open Lwt open Lwt_io type 'a t = 'a Lwt.t let (>>=) = (>>=) let return = return let fail = fail type in_channel = input_channel type out_channel = output_channel let open_connection addr = open_connection ~buffer_size:2097152 addr let output_char = write_char let output_binary_int = write_int let output_string = write let flush = flush let input_char = read_char let input_binary_int = read_int let really_input =read_into_exactly let close_in = close end module Lwt_db = PGOCaml_generic.Make(Thread) open Lwt_db open Lwt let query_user dbh id = PGSQL(dbh) "SELECT id,name,visited FROM user_db WHERE id=$id" let _ = Lwt_main.run (connect ~database:"schat" ()>|= function dbh -> query_user dbh 1L) (**********************************************) (**********************************************) when I try to compile : $ ocamlfind ocamlc -thread -c -package lwt,pgocaml,pgocaml.syntax -syntax camlp4o test.ml File "test.ml", line 34, characters 30-33: Error: This expression has type 'a Lwt_db.t = 'a PGOCaml_generic.Make(Thread).t but an expression was expected of type (string, bool) Hashtbl.t PGOCaml.t