<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/6c7eeee8f6105aa3a5ef377169475e2c"
  from="Chris GauthierDickey &lt;chrisg@c...&gt;"
  author="Chris GauthierDickey"
  date="2003-11-11T05:34:02"
  subject="[Caml-list] type issues with modules"
  prev="2003/11/fc1129f81c56884cc7eeba1ab3565fec"
  next="2003/11/e506f6dcbfdcb3186798daea27c0bc18"
  next-in-thread="2003/11/4ae1225ca603ad7ed2d2972c89a080a0"
  prev-thread="2003/11/aec9ff3da1a5c8e937e938441c778914"
  next-thread="2003/11/e506f6dcbfdcb3186798daea27c0bc18"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] type issues with modules">
<msg 
  url="2003/11/6c7eeee8f6105aa3a5ef377169475e2c"
  from="Chris GauthierDickey &lt;chrisg@c...&gt;"
  author="Chris GauthierDickey"
  date="2003-11-11T05:34:02"
  subject="[Caml-list] type issues with modules">
<msg 
  url="2003/11/4ae1225ca603ad7ed2d2972c89a080a0"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-11-11T08:21:56"
  subject="Re: [Caml-list] type issues with modules">
<msg 
  url="2003/11/65633c1752df3e2bba3cd125d0cb4054"
  from="Damien &lt;Damien.Pous@e...&gt;"
  author="Damien"
  date="2003-11-11T17:24:00"
  subject="Re: [Caml-list] type issues with modules">
<msg 
  url="2003/11/d0eed6c769ba31ae73ab39ba3e7c5d4f"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-11-12T01:12:24"
  subject="Re: [Caml-list] type issues with modules">
<msg 
  url="2003/11/a493c676415d2097c4bf8c63da328c5c"
  from="Remi Vanicat &lt;vanicat@l...&gt;"
  author="Remi Vanicat"
  date="2003-11-12T12:50:56"
  subject="Re: [Caml-list] type issues with modules">
</msg>
<msg 
  url="2003/11/db0b7771330fb626e89501442c3c06f5"
  from="Issac Trotts &lt;ijtrotts@n...&gt;"
  author="Issac Trotts"
  date="2003-11-13T21:30:31"
  subject="Re: [Caml-list] type issues with modules">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
I have a weird issue, but I'm not sure if it's related to the type
system or what's really going on.  I've boiled the problem down to the
simple case below. I have 4 files, two that are interfaces for the modules.

file: mod1.mli
type t1 = T1
val v: t1

file mod1.ml
type t1 = T1
let v = Mod2.f2 ()

file mod2.mli
val f2: unit -&gt; Mod1.t1

file mod2.ml
let f2 ()  = Mod1.T1


I compile the files as such:

ocamlc -g mod1.mli
ocamlc -g mod2.mli
ocamlc -g mod1.ml

at which point I get the error:
The implementation mod1.ml does not match the interface mod1.cmi:
Values do not match: val v : Mod1.t1 is not included in val v: t1

which seems a little odd since t1 is certainly contained in Mod1.t1. I
feel like the types at this point are known, defined in the interface
file and that we know that the types in the ml file belong to the same
module as the interface. Am I wrong?

If I had the type expressions and change mod1.ml to:
type t1 = T1
let v:(Mod1.t1)

and then mod1.mli to
type t1 = T1
let v:(Mod1.t1)

I get the error: Unbound type constructor Mod1.t1, which makes some
sense. But again I'd argue that at this point, we know the name of the
module, so Mod1.t1 is the same thing as t1.

Maybe I'm totally missing something obvious?

Thanks in advance,
Chris

P.S. I know I can move t1 into another module, but for software
engineering reasons, I don't want to do that.


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

</contents>

</message>

