<?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="2006/02/ff81f3a0998187a8f5ee076e75b3d851"
  from="Merijn de Jonge &lt;merijn.de.jonge@g...&gt;"
  author="Merijn de Jonge"
  date="2006-02-27T15:20:04"
  subject="Re: [Caml-list] Writing Identity Functors (or Wrapper modules) inOCAML"
  prev="2006/02/db31e32f91da0114f964a0797b9d8b0d"
  next="2006/02/8fbbefacc74504467b5d5fc4adb7449a"
  prev-in-thread="2006/02/db31e32f91da0114f964a0797b9d8b0d"
  next-in-thread="2006/02/7737a0dc5ef618b134b0d8fa4c1fa0e7"
  prev-thread="2006/02/85b7b8c6a9056190fef150185cb50a3c"
  next-thread="2006/02/8fc9c1a56c497b9743515a5e3432d704"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Writing Identity Functors (or Wrapper modules) in OCAML">
<msg 
  url="2006/02/e5953c6e2320144461b87a07084530c0"
  from="Merijn de Jonge &lt;merijn.de.jonge@g...&gt;"
  author="Merijn de Jonge"
  date="2006-02-27T14:49:53"
  subject="Writing Identity Functors (or Wrapper modules) in OCAML">
<msg 
  url="2006/02/c180a32c9168e878ef5f354c793b7312"
  from="Julien Signoles &lt;signoles@l...&gt;"
  author="Julien Signoles"
  date="2006-02-27T15:04:56"
  subject="Re: [Caml-list] Writing Identity Functors (or Wrapper modules) in OCAML">
<msg 
  url="2006/02/db31e32f91da0114f964a0797b9d8b0d"
  from="Sebastian Egner &lt;sebastian.egner@p...&gt;"
  author="Sebastian Egner"
  date="2006-02-27T15:14:54"
  subject="Re: [Caml-list] Writing Identity Functors (or Wrapper modules) 	inOCAML">
<msg 
  url="2006/02/ff81f3a0998187a8f5ee076e75b3d851"
  from="Merijn de Jonge &lt;merijn.de.jonge@g...&gt;"
  author="Merijn de Jonge"
  date="2006-02-27T15:20:04"
  subject="Re: [Caml-list] Writing Identity Functors (or Wrapper modules) inOCAML">
</msg>
</msg>
</msg>
<msg 
  url="2006/02/7737a0dc5ef618b134b0d8fa4c1fa0e7"
  from="Jean-Christophe Filliatre &lt;filliatr@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2006-02-27T15:07:20"
  subject="Re: [Caml-list] Writing Identity Functors (or Wrapper modules) in OCAML">
</msg>
</msg>
</thread>

<contents>
Hi guys,

Thank you all for the quick reply.

I overlooked the paragraph "Re-exported variant type or record type: an
equation, a representation."  Adding the "type representation" did the
trick.
I needed a concrete type, so the solution to make it abstract is not
appropriate in my case.

Thanks agin.

Merijn de Jonge


On 2/27/06, Sebastian Egner &lt;sebastian.egner@philips.com&gt; wrote:
&gt;
&gt;
&gt; &gt; &gt;       module type IHelloWorld =
&gt; &gt; &gt;       sig
&gt; &gt; &gt;          type helloWorldType = Hello | World
&gt; &gt; &gt;         val hello : unit -&gt; helloWorldType
&gt; &gt; &gt;       end
&gt; &gt; &gt;
&gt; &gt; &gt;       module Wrapper (X: IHelloWorld) : IHelloWorld =
&gt; &gt; &gt;       struct
&gt; &gt; &gt;         type helloWorldType = X.helloWorldType
&gt; &gt; &gt;         let hello = X.hello
&gt; &gt; &gt;       end
&gt; &gt;
&gt; &gt; You have to explicitely define Hello and World in the wrapper. Try this
&gt; :
&gt; &gt;
&gt; &gt; module Wrapper(X:IHelloWorld): IHelloWorld =
&gt; &gt; struct
&gt; &gt;   type helloWorldType = X.helloWorldType = Hello | Word
&gt; &gt;   let hello = X.hello
&gt; &gt; end
&gt;
&gt; Alternatively, you have defined too much In IHelloWorld
&gt; (depends on what you wanted to do in the first place).
&gt; Then try this:
&gt;
&gt;       module type IHelloWorld =
&gt;       sig
&gt;         type helloWorldType (* now abstract *)
&gt;         val hello : unit -&gt; helloWorldType
&gt;       end
&gt;
&gt;       module Wrapper (X: IHelloWorld) :
&gt;         (IHelloWorld with type helloWorldType = X.helloWorldType) =
&gt;       struct
&gt;         type helloWorldType = X.helloWorldType
&gt;         let hello = X.hello
&gt;       end
&gt;
&gt;         ...
&gt;
&gt; Sebastian Egner.

</contents>

</message>

