caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andre Nathan <andre@digirati.com.br>
To: caml-list@inria.fr
Subject: Another question about modules
Date: Tue, 15 Jul 2008 17:41:35 -0300	[thread overview]
Message-ID: <1216154495.5294.9.camel@homesick> (raw)

Hello

I'm having an issue that is similar to the one reproduced in the code
below:

a.ml:

module SubA :
  sig
    type t
    val f : t -> unit
    val id : t -> int
  end =
  struct
    type t = { id: int }
    let f = B.f
    let id x = x.id
  end

a.mli:

module SubA :
  sig
    type t
    val f : t -> unit
    val id : t -> int
  end

b.ml:

open A
let f x = print_int (SubA.id x)

b.mli:

open A
val f : SubA.t -> unit


When I compile this, I get the following message:

File "a.ml", line 7, characters 2-75:
Signature mismatch:
Modules do not match:
  sig type t = { id : int; } val f : A.SubA.t -> unit val id : t -> int
end
is not included in
  sig type t val f : t -> unit val id : t -> int end
Values do not match:
  val f : A.SubA.t -> unit
is not included in
  val f : t -> unit


Shouldn't "t" (from A.SubA) and A.SubA.t be recognized as the same type
here? I don't understand why they aren't. Is there any workaround for
this issue or is this kind of thing (yet again) a sign that there's
something fishy in my design?

Thanks in advance,
Andre


             reply	other threads:[~2008-07-15 20:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 20:41 Andre Nathan [this message]
2008-07-15 22:51 ` [Caml-list] " Andre Nathan
2008-07-16  0:18   ` Ashish Agarwal
2008-07-16  0:44     ` Andre Nathan
2008-07-16  1:05       ` Ashish Agarwal
2008-07-16 14:05         ` Daniel Bünzli
2008-07-16  1:54       ` Martin Jambon
2008-07-16 14:15         ` Andre Nathan

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=1216154495.5294.9.camel@homesick \
    --to=andre@digirati.com.br \
    --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).