Browse thread
Mutually recursive types in different modules
-
Andre Nathan
-
Jon Harrop
- Andre Nathan
-
Arthur Chan
- Andre Nathan
- Martin Jambon
-
Jon Harrop
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Andre Nathan <andre@d...> |
| Subject: | Re: [Caml-list] Mutually recursive types in different modules |
On Mon, 2008-07-14 at 10:57 -0700, Arthur Chan wrote: > As Jon demonstrates it is "possible," but I do not think it truly > achieves what you are trying to do. What is your use case? I do not > recommend trying to make types recursive across modules. Even > recursively defined modules have reared their ugly end on me. It is > equivalent to writing non-orthogonal code, in the functional paradigm > (see Pragmatic Programmer). I had a graph type that depended on a vertex type (Vertex.t), which in its turn is a record with a graph field (of type Graph.t). I parametrized the Graph.t type and then used it in the Vertex module as "vertex Graph.t". I guess I have a better design now. Thanks, Andre