Original bug ID: 6016
Reporter: @diml
Assigned to: @diml
Status: closed (set by @xavierleroy on 2016-12-07T10:47:21Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: later
Target version: later
Fixed in version: 4.02.2+dev / +rc1
Category: typing
Related to: #6623
Monitored by: bobot "Julien Signoles" @Chris00
Bug description
All type declarations are by default recursive. This is a problem when one wants to alias a type in a sub-module. The classic solution is to create a "proxy" type:
type t
module M = struct
type tmp = t
type t = tmp
end
At Jane Street we have been using a camlp4 extension to do that automatically when a type is marked with the keyword "nonrec":
type t
module M = struct
type nonrec t = t
end
We believe it could be useful to everybody and it would be better to have it into the language proper, for instance to avoid polluting signatures with useless types everywhere.
File attachments
Original bug ID: 6016
Reporter: @diml
Assigned to: @diml
Status: closed (set by @xavierleroy on 2016-12-07T10:47:21Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: later
Target version: later
Fixed in version: 4.02.2+dev / +rc1
Category: typing
Related to: #6623
Monitored by: bobot "Julien Signoles" @Chris00
Bug description
All type declarations are by default recursive. This is a problem when one wants to alias a type in a sub-module. The classic solution is to create a "proxy" type:
At Jane Street we have been using a camlp4 extension to do that automatically when a type is marked with the keyword "nonrec":
We believe it could be useful to everybody and it would be better to have it into the language proper, for instance to avoid polluting signatures with useless types everywhere.
File attachments