caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <xavier.leroy@inria.fr>
To: brogoff@speakeasy.net
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Recursive modules and polymorphic recursion
Date: Thu, 26 Jun 2003 14:14:15 +0200	[thread overview]
Message-ID: <20030626141415.B11992@pauillac.inria.fr> (raw)
In-Reply-To: <Pine.LNX.4.44.0306252139470.32188-100000@grace.speakeasy.net>; from brogoff@speakeasy.net on Wed, Jun 25, 2003 at 09:58:50PM -0700

>     I was playing with the recursive modules in the CVS snapshot and
> much to my chagrin the very first pr function of the very first pr
> example in Okasaki causes the system to barf, where barf means
> "Cannot safely evaluate the definition of the recursively-defined
> module RAListImpl". Is this a temporary limitation of the CVS
> version or a permanent limitation of the feature?  I've appended the
> code to this email.

As the design document explains
(http://pauillac.inria.fr/~xleroy/publi/recursive-modules-note.pdf),
the current implementation of recursive modules is such that a definition
        module rec A : SIGA = StructA
is accepted only if all value components of SIGA are functions.  This
isn't the case in your example because of the "empty" value component.
This restriction comes from the way ill-founded recursions are
detected at run-time.

Yes, it's an unfortunate restriction, and eventually it will go away
once I figure out a suitable static analysis for well-foundedness of
recursive definitions.  But this may take a while.

The decision to integrate recursive modules in 3.07 was taken on the
grounds that imperfect recursive modules are still better than no
recursive modules at all.  Be patient: perfection takes time.

- Xavier Leroy

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


  reply	other threads:[~2003-06-26 12:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-26  4:58 brogoff
2003-06-26 12:14 ` Xavier Leroy [this message]
2003-06-26 13:15   ` brogoff

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=20030626141415.B11992@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=brogoff@speakeasy.net \
    --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).