From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=AWL,DNS_FROM_RFC_POST, HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 9AE19BB84 for ; Wed, 16 Jul 2008 02:18:32 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak0FAI/bfEjAXQIm/2dsb2JhbACCPzOPCJdthmw X-IronPort-AV: E=Sophos;i="4.30,369,1212357600"; d="scan'208";a="15143667" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 16 Jul 2008 02:18:32 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m6G0IVex011232 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 16 Jul 2008 02:18:32 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsAHAMzbfEjRVcbmY2dsb2JhbACCPzOPCDkaBB6We4Zs X-IronPort-AV: E=Sophos;i="4.30,369,1212357600"; d="scan'208";a="13146839" Received: from rv-out-0506.google.com ([209.85.198.230]) by mail2-smtp-roc.national.inria.fr with ESMTP; 16 Jul 2008 02:18:25 +0200 Received: by rv-out-0506.google.com with SMTP id k40so4882175rvb.57 for ; Tue, 15 Jul 2008 17:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=Dwoc8V7DtQVT719Gpj3kHxVlFdGRy9upwBrr+87VbUU=; b=wIwPRm+j2zVt9L2plA4XJXuP8v7adL9D3lEnTKIZ0ZSV7g3I5KP7rz+ttxQVToBkmG PErghnRq3fyQ1KjbFm4QAJ+zag4znsmqEvYYniGgRG42XawXEH9kT6A27dfV9fomPwvh 1dA3HsStO0bhlcf/nfjQfcnfD0fns/ZWNSL7A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=YYzPzyaNnZzSU3+300uVeLnMjGLIW8sxD/GXIbFLvIMUEmMWKYjZJ3vEWJl/a6x7A2 ULeP7W4cv9InFzl2GKySBbcFvAHiaBVnnWHF8p/a5AOcZZMLjG3+5hYSNW53uPt+RPYr pv+SHI89cJGltkFWmDuj+P5ImUX+ZqzvnGom4= Received: by 10.141.198.9 with SMTP id a9mr7846605rvq.238.1216167503702; Tue, 15 Jul 2008 17:18:23 -0700 (PDT) Received: by 10.141.19.4 with HTTP; Tue, 15 Jul 2008 17:18:23 -0700 (PDT) Message-ID: Date: Tue, 15 Jul 2008 20:18:23 -0400 From: "Ashish Agarwal" To: "Andre Nathan" Subject: Re: [Caml-list] Another question about modules Cc: caml-list@inria.fr In-Reply-To: <1216162299.5294.22.camel@homesick> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11415_25899953.1216167503745" References: <1216154495.5294.9.camel@homesick> <1216162299.5294.22.camel@homesick> X-Miltered: at discorde with ID 487D3E57.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; mli:01 val:01 mli:01 val:01 beginner's:01 ocaml:01 bug:01 beginner's:01 ocaml:01 bug:01 1975:98 nathan:98 nathan:98 beginners:01 beginners:01 ------=_Part_11415_25899953.1216167503745 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Firstly, you have a circular dependency. How are you compiling? That should be the first error you get. On Tue, Jul 15, 2008 at 6:51 PM, Andre Nathan wrote: > I think this is similar to this simpler problem: > > a.ml: > > type t = { id: int } > let f x = print_int x.id; B.f x > > a.mli: > > type t > val f : t -> unit > > b.ml: > > let f x = print_int 42 > > b.mli: > > val f : A.t -> unit > > > Which results in "This expression has type t but is here used with type > A.t" in a.ml, even though t and A.t are the same type. Is there a > general solution for this kind of situation? > > Thanks, > Andre > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > ------=_Part_11415_25899953.1216167503745 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Firstly, you have a circular dependency. How are you compiling? That should be the first error you get.


On Tue, Jul 15, 2008 at 6:51 PM, Andre Nathan <andre@digirati.com.br> wrote:
I think this is similar to this simpler problem:

a.ml:

 type t = { id: int }
 let f x = print_int x.id; B.f x

a.mli:

 type t
 val f : t -> unit

b.ml:

 let f x = print_int 42

b.mli:

 val f : A.t -> unit


Which results in "This expression has type t but is here used with type
A.t" in a.ml, even though t and A.t are the same type. Is there a
general solution for this kind of situation?

Thanks,
Andre

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

------=_Part_11415_25899953.1216167503745--