Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module abbreviations may break type equality ? #4049

Closed
vicuna opened this issue Jun 19, 2006 · 2 comments
Closed

module abbreviations may break type equality ? #4049

vicuna opened this issue Jun 19, 2006 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jun 19, 2006

Original bug ID: 4049
Reporter: Keiko NAKATA
Status: closed (set by @xavierleroy on 2006-08-30T12:01:27Z)
Resolution: not fixable
Priority: normal
Severity: minor
Version: 3.09.2
Category: ~DO NOT USE (was: OCaml general)
Related to: #3476 #4615 #5302

Bug description

I think the code below should type check, but not in fact.
This may relate to #3476, or I might misunderstanding something.

module A = struct
module B = struct type t let compare x y = 0 end
module S = Set.Make(B)
let empty = S.empty
end

module A1 = A
let _ = A1.empty = A.empty

Best regards,
Keiko

@vicuna
Copy link
Author

vicuna commented Aug 30, 2006

Comment author: @xavierleroy

If you look at the example,
A.S.t is equal to Set.Make(A.B).t
and A1.S.t is equal to Set.Make(A1.B).t

The module type-checker does not know that A.B = A1.B, if only because it doesn't know anything about equalities between modules in general (only about equalities between type components).

This is a known limitation of applicative functors as implemented in OCaml.
(See PR #3476 for another example). I don't think this limitation will ever be lifted in OCaml.

@lpw25
Copy link
Contributor

lpw25 commented May 18, 2020

This was fixed when module aliases were added to the language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants