|Anonymous | Login | Signup for a new account||2017-10-19 07:19 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005777||OCaml||~DO NOT USE (was: OCaml general)||public||2012-10-07 14:32||2016-12-12 16:50|
|Priority||normal||Severity||feature||Reproducibility||have not tried|
|Target Version||Fixed in Version|
|Summary||0005777: Update mode for inferring mli files|
|Description||Some people reported that they want selectively infer signatures for specific entries - value or types by annotating them in some way in the ml file. (e.g 0005764)|
I'm proposing completely different solution.
If somebody specifies something like:
ocamlc -infer-update foo.ml
when the mli is not present it will create with all the entries like normally -i would normally print. Otherwise it will re-parse the mli file, compare if the signatures change with some specific rules, and then replace these entries but only with the new ones.
|Tags||No tags attached.|
What about the following example:
type t = int
let f x = x + 1
val f: t -> int
I now change implementation as follows:
type t = float
let f x = x +. 1.
The inferred type for f is float -> float. How should the .mli be updated? I would like:
val f: t -> float
But it does not seem easy to decide that we want to keep t.
|I really don't like the idea that the compiler would parse some source file, modify it, and save it back. I've nothing against an external tool trying to do it properly (preserving the formatting and comments of the original file), but I don't think this is robust enough for a compiler and that we should encourage this workflow.|
|frisch, I agree with you, how about my proposal?|
> how about my proposal?
Do you mean the "private" syntax proposed in 0005764?
I don't have a strong opinion on the subject. For me, having to write the .mli file is not a problem. But it makes sense to have a way to define a structure item for the rest of the module but hide it automatically from the resulting signature.
|This proposal does not appear to have been well-received in 2012. I move to close this issue.|
|2012-10-07 14:32||meyer||New Issue|
|2012-10-07 14:34||meyer||Description Updated||View Revisions|
|2012-10-08 02:29||meyer||Description Updated||View Revisions|
|2012-10-30 14:42||Bardou||Note Added: 0008369|
|2012-10-30 16:37||frisch||Note Added: 0008371|
|2012-10-31 02:42||hongboz||Note Added: 0008375|
|2012-10-31 17:24||frisch||Note Added: 0008379|
|2013-06-28 17:51||doligez||Status||new => feedback|
|2016-12-12 16:49||shinwell||Note Added: 0016969|
|2016-12-12 16:50||shinwell||Status||feedback => closed|
|2016-12-12 16:50||shinwell||Resolution||open => won't fix|
|2017-02-23 16:36||doligez||Category||OCaml general => -OCaml general|
|2017-03-03 17:55||doligez||Category||-OCaml general => -(deprecated) general|
|2017-03-03 18:01||doligez||Category||-(deprecated) general => ~deprecated (was: OCaml general)|
|2017-03-06 17:04||doligez||Category||~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)|
|Copyright © 2000 - 2011 MantisBT Group|