<?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="2002/07/9318d960b2578fae39e524c42bcf2882"
  from="Nicolas FRANCOIS &lt;nicolas.francois@f...&gt;"
  author="Nicolas FRANCOIS"
  date="2002-07-16T09:51:19"
  subject="Re: [Caml-list] About modules again"
  prev="2002/07/4bbe8c44332ba5a3150f66f671c75eaa"
  next="2002/07/a4e7111559c35cc347dce02da761c6d4"
  prev-in-thread="2002/07/47f6ab2d7a669a9060d5725cfc33d0cb"
  prev-thread="2002/07/9d191dbdc8b05bc3b233f36a11ac6504"
  next-thread="2002/07/9c344668384b0077ed1732712963cb19"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] About modules again">
<msg 
  url="2002/07/1b29cfdfd19552b03e846f44303aa30e"
  from="Nicolas FRANCOIS &lt;nicolas.francois@f...&gt;"
  author="Nicolas FRANCOIS"
  date="2002-07-15T00:35:01"
  subject="[Caml-list] About modules again">
<msg 
  url="2002/07/47f6ab2d7a669a9060d5725cfc33d0cb"
  from="Markus Mottl &lt;markus@o...&gt;"
  author="Markus Mottl"
  date="2002-07-15T08:44:45"
  subject="Re: [Caml-list] About modules again">
<msg 
  url="2002/07/9318d960b2578fae39e524c42bcf2882"
  from="Nicolas FRANCOIS &lt;nicolas.francois@f...&gt;"
  author="Nicolas FRANCOIS"
  date="2002-07-16T09:51:19"
  subject="Re: [Caml-list] About modules again">
</msg>
</msg>
</msg>
</thread>

<contents>
Le Mon, 15 Jul 2002 10:44:35 +0200 Markus Mottl &lt;markus@oefai.at&gt; a écrit
:


&gt; This is the point where higher-order modules (functors) enter the game.
&gt; If you have some common functionality that is shared across all rings,
&gt; you can factor it out in a functor body. E.g.:
&gt; 
&gt;   module MakeRing (Spec : RING_SPEC) : RING = struct
&gt;     include Spec
&gt; 
&gt;     (* All common stuff follows here *)
&gt;   end
&gt; 
&gt; Module "Spec" should adhere to a signature "RING_SPEC", the latter
&gt; specifying what is different or at least parameterizable for each
&gt; ring. Applying the functor to such a specification yields a module that
&gt; implements the signature RING, e.g.:
&gt; 
&gt;   module Ring_Z = MakeRing (Ring_Z_Spec)
&gt; 
&gt; The specification of rings over Z (Ring_Z_Spec) may itself be the result
&gt; of a functor application. This way you can highly modularize the
&gt; creation of algebraic structures.

I see your point. Conway does something like this in his math packages.
I'll try to adapt the technique.

Thanks Markus.

\bye

-- 

                   Nicolas FRANCOIS
            http://nicolas.francois.free.fr
 A TRUE Klingon programmer does NOT comment his code
-------------------
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>

