caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Another question about modules
@ 2008-07-15 20:41 Andre Nathan
  2008-07-15 22:51 ` [Caml-list] " Andre Nathan
  0 siblings, 1 reply; 8+ messages in thread
From: Andre Nathan @ 2008-07-15 20:41 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-07-16 14:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-15 20:41 Another question about modules Andre Nathan
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

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).