caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* A functor to produce recursive modules ?
@ 2008-05-22 20:58 Fabrice Marchant
  2008-05-23  6:18 ` [Caml-list] " Alain Frisch
  0 siblings, 1 reply; 9+ messages in thread
From: Fabrice Marchant @ 2008-05-22 20:58 UTC (permalink / raw)
  To: caml-list

Hi !

  Apologize. This topic isnt't exactly at its right place : belongs to Beginners-list.
However no answer about this question there and so much clever people here, a denser traffic...

  Please how to define recursive modules that are parametrized by an OrderedType ?
Say these modules types are Mod and ModSet.
(Because a function f in module Mod uses a Set of Mod)

The problem is I need recursive functors that returns 2 modules.

Waiting for a solution, I bypass the problem in defining a non-recursive functor Mod.Make and a Mod function f that returns a Mod List instead of the wanted Mod Set.

 module StringMod = Mod.Make ( String )

Of course it's then possible to convert the StringMod List to a StringMod Set but a cleaner work would be to write this a single time a general way inside the functor Mod.Make...

Here is an example :
http://fabrice.marchant.free.fr/graph/example/

The module 'digraph' holds a Make functor that produces an oriented graph of any OrderedType.

 The function 'search_loops' returns a list of the loops:Digraph found in the Digraph.

Please how to change things to return a _ Set _ of Digraphs instead ?

The manual explains how to define simple recursive modules, but I do not see the way to perform this with parametred modules.

Any light ?

Fabrice


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

end of thread, other threads:[~2008-05-23 23:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-22 20:58 A functor to produce recursive modules ? Fabrice Marchant
2008-05-23  6:18 ` [Caml-list] " Alain Frisch
2008-05-23 18:00   ` Fabrice Marchant
2008-05-23 19:40   ` Fabrice Marchant
2008-05-23 19:42   ` Fabrice Marchant
2008-05-23 22:02     ` Till Varoquaux
2008-05-23 21:37       ` Fabrice Marchant
2008-05-23 22:25     ` Jeremy Yallop
2008-05-23 21:37       ` Fabrice Marchant

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