caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andre Nathan <andre@digirati.com.br>
To: Arthur Chan <baguasquirrel@gmail.com>
Cc: Jon Harrop <jon@ffconsultancy.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Mutually recursive types in different modules
Date: Mon, 14 Jul 2008 15:04:46 -0300	[thread overview]
Message-ID: <1216058686.29061.11.camel@andre.mz.digirati.com.br> (raw)
In-Reply-To: <74cabd9e0807141057u64b31518h49627afb30de5503@mail.gmail.com>

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


  reply	other threads:[~2008-07-14 18:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 16:50 Andre Nathan
2008-07-14 17:04 ` [Caml-list] " Jon Harrop
2008-07-14 17:50   ` Andre Nathan
2008-07-14 17:57   ` Arthur Chan
2008-07-14 18:04     ` Andre Nathan [this message]
2008-07-14 17:43 ` Martin Jambon

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=1216058686.29061.11.camel@andre.mz.digirati.com.br \
    --to=andre@digirati.com.br \
    --cc=baguasquirrel@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    /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).