caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ashish Agarwal <agarwal1975@gmail.com>
To: Caml List <caml-list@inria.fr>
Subject: [Caml-list] substituting recursive types inside a signature
Date: Mon, 2 Nov 2015 15:01:01 -0500	[thread overview]
Message-ID: <CAMu2m2L4jA3KeXQoTva=8UGYvsPHZ6FWEM=am3GkASGgkGhvzw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

$ cat foo.ml
module M = struct
  type t = A | B of u
  and u = C of t
end

module type N = sig
  include module type of M
    with type t = M.t
    and type u = M.u
end

$ ocamlc -c foo.ml
File "foo.ml", line 8, characters 9-21:
Error: This variant or record definition does not match that of type M.t
       The types for field B are not equal.

I guess the "and" in the constraint doesn't make the constraints mutually
recursive, so what does it do?

[-- Attachment #2: Type: text/html, Size: 786 bytes --]

             reply	other threads:[~2015-11-02 20:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 20:01 Ashish Agarwal [this message]
2015-11-05  2:10 ` Jacques Garrigue
2015-11-05  3:22   ` Ashish Agarwal
2015-11-05  3:24     ` Ashish Agarwal

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='CAMu2m2L4jA3KeXQoTva=8UGYvsPHZ6FWEM=am3GkASGgkGhvzw@mail.gmail.com' \
    --to=agarwal1975@gmail.com \
    --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).