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

sig_of_struct #2737

Closed
vicuna opened this issue Jun 17, 2004 · 2 comments
Closed

sig_of_struct #2737

vicuna opened this issue Jun 17, 2004 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Jun 17, 2004

Original bug ID: 2737
Reporter: administrator
Status: closed (set by @damiendoligez on 2012-01-30T14:09:39Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 3.12.0
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Evgeny Chukreev
Version:
OS:
Submission from: 81.176.98.115 (81.176.98.115)

Feature wish:
It's impossible now to write code like:

module B =
struct
(* blah-blah-blah *)
end

module type A =
sig
(* blah-blah-blah *)

  include (sig_of_struct B)

end

@vicuna
Copy link
Author

vicuna commented Jun 17, 2004

Comment author: administrator

Full_Name: Evgeny Chukreev

Feature wish:
It's impossible now to write code like:

module B =
struct
(* blah-blah-blah *)
end

module type A =
sig
(* blah-blah-blah *)

  include (sig_of_struct B)

end

This is also a feature I would like to have.
However, there is a small "moral" problem: as the signature of B is
not given explicitly, you are relying on the type checker to produce,
and it could be for instance more general than you expected.
I.e. a function may be more polymorphic than expected, and as a result
the signature produced would be incompatible with the expected one.
I don't see it as a major problem, but it may be a religious issue for
some.

On the other hand, it should be possible at least to have a weaker
feature: have the .mli define a module type.
This would make easier providing a signature to an extended module.

Jacques

@vicuna
Copy link
Author

vicuna commented Jan 30, 2012

Comment author: @damiendoligez

This is the "module type of" feature that was introduced in 3.12.0.

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

1 participant