caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] substituting recursive types inside a signature
@ 2015-11-02 20:01 Ashish Agarwal
  2015-11-05  2:10 ` Jacques Garrigue
  0 siblings, 1 reply; 4+ messages in thread
From: Ashish Agarwal @ 2015-11-02 20:01 UTC (permalink / raw)
  To: Caml List

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-05  3:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 20:01 [Caml-list] substituting recursive types inside a signature Ashish Agarwal
2015-11-05  2:10 ` Jacques Garrigue
2015-11-05  3:22   ` Ashish Agarwal
2015-11-05  3:24     ` Ashish Agarwal

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