From: Christopher Dutchyn <cdutchyn@cs.ubc.ca>
To: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>
Cc: edgin@slingshot.co.nz, caml-list@inria.fr
Subject: Re: [Caml-list] Circular module dependencies
Date: Tue, 7 Sep 2004 10:10:26 -0700 (PDT) [thread overview]
Message-ID: <Pine.GSO.4.60.0409070957500.12661@cascade.cs.ubc.ca> (raw)
In-Reply-To: <20040907.112856.50024508.garrigue@kurims.kyoto-u.ac.jp>
But what about (self- or mutually-) recursive modules? By definition,
they are cyclic, and neither suggested solution may work. I use them to
structure language semantics, and it's really convenient to have open
recursion to different procedures and types. I could restructure it into
a single module, but then I couldn't mix-and-match.
I also appreciate the -rectypes option to Ocaml too; two-level types (a la
Sheard and Pasalic) are elegant, and recursive types let me remove the
superfluous tagging that Haskell needs.
So I think circularity is valuable, but I need to be careful to show my
recursions are well-founded.
--
Christopher Dutchyn
UBC Computer Science
On Tue, 7 Sep 2004, Jacques GARRIGUE wrote:
> From: Tony Edgin <edgin@slingshot.co.nz>
>
>> Recently, there was a thread which talked about how difficult module
>> dependencies were to resolve for linking in Ocaml. I'm guessing this is
>> because of cycles in the dependency graph.
>>
>> My thought is that maybe Ocaml shouldn't allow this to happen. Wouldn't
>> cyclical module dependencies be a symptom of bad design?
>
> Bingo. Ocaml does not allow it. It just happens that you can cheat the
> compiler into accepting two different acyclic dependency graphs: one
> for the types (compilation order of the .mli's) and one for the values
> (compilation order of the .ml's). This was never intended, but there
> is no specific reason to go to great length to defeat that trick, as
> it is still safe.
>
> At least that's my take on the question.
>
>> If a cyclic dependency occurs I can think of two ways of removing.
>
> Indeed, this is the reasonable approach.
>
> ---------------------------------------------------------------------------
> Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp
> <A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>
>
> -------------------
> 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
>
-------------------
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
next prev parent reply other threads:[~2004-09-07 17:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-07 9:17 Tony Edgin
2004-09-07 2:28 ` Jacques GARRIGUE
2004-09-07 17:10 ` Christopher Dutchyn [this message]
2004-09-07 4:39 ` brogoff
2004-09-07 6:12 ` Erik de Castro Lopo
2004-09-07 12:36 ` brogoff
2004-09-07 13:39 ` Christopher A. Watford
2004-09-08 0:30 ` Erik de Castro Lopo
2004-09-07 6:14 ` Nicolas Cannasse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.60.0409070957500.12661@cascade.cs.ubc.ca \
--to=cdutchyn@cs.ubc.ca \
--cc=caml-list@inria.fr \
--cc=edgin@slingshot.co.nz \
--cc=garrigue@kurims.kyoto-u.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox