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

Relaxing the coherence check for with-constraint re-exports #6360

Closed
vicuna opened this issue Apr 3, 2014 · 3 comments
Closed

Relaxing the coherence check for with-constraint re-exports #6360

vicuna opened this issue Apr 3, 2014 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Apr 3, 2014

Original bug ID: 6360
Reporter: @alainfrisch
Assigned to: @garrigue
Status: confirmed (set by @mshinwell on 2014-05-30T12:13:35Z)
Resolution: open
Priority: normal
Severity: feature
Target version: later
Category: typing
Monitored by: @gasche

Bug description

It is possible to specify a re-export of a concrete type in a with-constraint:

module M = struct type t = A end
module type S1 = sig type t = A end
module type S2 = S1 with type t = M.t

Is is expected for this feature to be sensitive to the ordering of with-constraints?

module M = struct type t = A of s and s = B end;;
module type S1 = sig type t = A of s and s = B end;;
module type S2 = S1 with type t = M.t and type s = M.s;; (* fails )
module type S3 = S1 with type s = M.s and type t = M.t;; (
succeeds *)

It seems there is no way to use this feature with mutually recursive declarations:

module M = struct type t = A of s and s = B of t end;;
module type S1 = sig type t = A of s and s = B of t end;;
module type S2 = S1 with type t = M.t and type s = M.s;; (* fails )
module type S3 = S1 with type s = M.s and type t = M.t;; (
fails *)

Wouldn't it be possible to run the coherence check after all constraints have been applied?

@vicuna
Copy link
Author

vicuna commented Apr 4, 2014

Comment author: @garrigue

The fact the ordering matters is a well-known limitation.
(Basically with constraints are applied incrementally.)
But maybe it was not noted before that this makes impossible to instantiate mutually recursive types.

@vicuna
Copy link
Author

vicuna commented May 30, 2014

Comment author: @mshinwell

Does this require an addition to the documentation?

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

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

No branches or pull requests

2 participants