Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: John Carr <jfc@mit.edu>
To: Caml List <caml-list@pauillac.inria.fr>
Subject: Re: [Caml-list] module types
Date: Thu, 03 Jun 2004 14:33:40 -0400	[thread overview]
Message-ID: <200406031833.i53IXe5a023254@psi-phi.mit.edu> (raw)
In-Reply-To: Your message of "Thu, 03 Jun 2004 19:26:19 +0200." <20040603192619.2a50e1f5@mostha>


I also have a problem with module types.  Suppose I have

	module type T = sig type t val f : t -> string end

If I want to declare a module implementing this signature I can write

	module X : T with type t = int

but this similar declaration is not allowed

	module Y : T with type t = A | B | C

The manual implies this restriction is intentional, a result of not
allowing unnamed constructor types.  I also tried

	module Y : sig include T type t = A | B | C end

but the compiler considered this to be an illegal duplicate
definition of type t.

1. Is there a reason not to allow (A | B | C) as an anonymous
type declaration?

2. Is there a way to do what I want without declaring the type name
outside the module?  I prefer to limit the scope of type names.

-------------------
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-06-03 18:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-03 17:26 Damien
2004-06-03 18:33 ` John Carr [this message]
2004-06-03 23:13   ` skaller
2004-06-04  8:41 ` Julien Signoles

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=200406031833.i53IXe5a023254@psi-phi.mit.edu \
    --to=jfc@mit.edu \
    --cc=caml-list@pauillac.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