caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Tom Hirschowitz <hirschow@mouton.inria.fr>
To: caml-list@inria.fr
Subject: Re: circular types?
Date: Mon, 23 Oct 2000 09:43:19 +0200	[thread overview]
Message-ID: <200010230743.e9N7hJv12430@concorde.inria.fr> (raw)

> Nope, no forwards in Ocaml. At some point, you'll have to tie the recursive 
> knot with an "and". If the problem you're having is that "far away" means 
> "in different modules" then you bump into the lack of recursive modules, 
> IMO the biggest PITA with ML style modules.

Hi, 

I'm pleased to see I'm not working for nobody. 
Actually I'm not working exactly on recursive modules, but rather on 
mixin modules.
Instead of defining your two modules and then link them, you would 
create a new one with the holes filled.
For instance, for Brain's example, you would write something like : 

mixin A = 
  mix 
    deferred module CompositeSet : sig type t ... end
    type composite = { data : string ; children : CompositeSet.t }
  end;;

mixin B = 
  mix
    deferred type composite
    module CompositeSet = 
      struct
        type t = C of composite | D
      end
  end

mixin C = A + B

In fact, this one is too difficult for me right now, because it 
relies on a mutual dependency between a type and a module.
Since I'm just beginning this, I would really be pleased by any 
comments, suggestions or questions about it.

Ciao.

Tom




             reply	other threads:[~2000-10-23 11:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-23  7:43 Tom Hirschowitz [this message]
2000-10-23 15:35 ` Brian Rogoff
2000-10-25 14:03   ` John Max Skaller
2000-10-25 19:47     ` Brian Rogoff
2000-10-26  9:12     ` Hendrik Tews
2000-10-26 16:37       ` John Max Skaller
2000-10-24  8:37 ` Hendrik Tews
2000-10-25 14:31   ` John Max Skaller
2000-10-26  8:51     ` Hendrik Tews
  -- strict thread matches above, loose matches on Subject: below --
2000-10-24  8:48 Tom Hirschowitz
2000-10-26  8:39 ` Hendrik Tews
2000-10-26  9:11   ` Tom Hirschowitz
2000-10-20  2:35 Chris Hecker
2000-10-20 12:24 ` Pierre Weis
2000-10-20 21:34   ` Chris Hecker
2000-10-21  8:02     ` Pierre Weis
2000-10-21 18:37       ` Chris Hecker
2000-10-21 12:22     ` Vitaly Lugovsky
2000-10-21 18:29       ` Chris Hecker
2000-10-21 22:36     ` Brian Rogoff
2000-10-23 18:43     ` Anton Moscal

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=200010230743.e9N7hJv12430@concorde.inria.fr \
    --to=hirschow@mouton.inria.fr \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).