Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Shaddin Doghmi <shaddin@mitre.org>
To: caml-list@inria.fr
Subject: [Caml-list] mutually recursive modules, strange behaviour in signature
Date: Sun, 15 Aug 2004 13:01:07 -0400	[thread overview]
Message-ID: <411F96D3.9020403@mitre.org> (raw)

In ocaml 3.07 and 3.08, it seems that in the signature of a module one 
can not refer to a module type defined in a mutually recursive module. 
This example does not compile:
-------------------------------------
# module rec A:
  sig
    module type w=sig end
  end=
  struct
    module type w = sig end
  end
and B:
    sig
      module Z(X:A.w):sig end
    end =
      struct
        module Z (X:A.w)=struct end
      end
;;
                            Characters 131-134:
        module Z(X:A.w):sig end
                   ^^^
Unbound module type A.w
-----------------------------------------------

however, this one does compile just fine:
---------------------------------
# module rec A:
  sig
    module type w=sig end
  end=
  struct
    module type w = sig end
  end
and B:
    sig
      module Z(X:sig end):sig end
    end =
      struct
        module Z (X:A.w)=struct end
      end
;;

-------------------------------

is there a reason why this happens?

-------------------
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:[~2004-08-15 17:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=411F96D3.9020403@mitre.org \
    --to=shaddin@mitre.org \
    --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