From: Jacques Carette <carette@mcmaster.ca>
To: OCaml <caml-list@inria.fr>
Subject: Rank-2 polymorphism woes in module signatures
Date: Sun, 18 Feb 2007 18:18:15 -0500 [thread overview]
Message-ID: <45D8DEB7.3030004@mcmaster.ca> (raw)
[Simplified problem]:
module type Symantics = sig
type ('c,'sv,'dv) repr
type ('c, 'sv, 'dv) pack = {
_lam : 'sa 'sb 'da 'db . (('c,'sa,'da) repr -> ('c,'sb,'db) repr)
-> ('c,(('c,'sa,'da) repr -> ('c,'sb,'db) repr),'da->'db) repr;
}
end
(* concrete *)
module R = struct
type ('c,'sv,'dv) repr = 'dv
type ('c, 'sv, 'dv) pack = {
_lam : 'sa 'sb 'da 'db . (('c,'sa,'da) repr -> ('c,'sb,'db) repr)
-> ('c,(('c,'sa,'da) repr -> ('c,'sb,'db) repr),'da->'db) repr;
}
end;;
module XX(S:Symantics) = struct end;;
module XXR = XX(R);;
and I get
Signature mismatch:
Modules do not match:
[...]
is not included in
Symantics
Type declarations do not match:
type ('a, 'b, 'c) pack =
('a, 'b, 'c) R.pack = {
_lam :
'd 'e 'f 'g.
(('a, 'd, 'f) repr -> ('a, 'e, 'g) repr) ->
('a, ('a, 'd, 'f) repr -> ('a, 'e, 'g) repr, 'f -> 'g) repr;
}
is not included in
type ('a, 'b, 'c) pack = {
_lam :
'd 'e 'f 'g.
(('a, 'd, 'f) repr -> ('a, 'e, 'g) repr) ->
('a, ('a, 'd, 'f) repr -> ('a, 'e, 'g) repr, 'f -> 'g) repr;
}
Those look absolutely identical to me - especially since the definitions
were done via copy & paste.
The rank-1 parts of the same record work fine [not shown], but none of
the rank-2 parts do. The above is a minimal extraction from a real program.
Can anyone help? [This is in 3.09.01]
Jacques
next reply other threads:[~2007-02-18 23:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-18 23:18 Jacques Carette [this message]
2007-02-19 0:58 ` [Caml-list] " Jacques Garrigue
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=45D8DEB7.3030004@mcmaster.ca \
--to=carette@mcmaster.ca \
--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