|Anonymous | Login | Signup for a new account||2015-04-26 13:34 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005777||OCaml||OCaml general||public||2012-10-07 14:32||2013-06-28 17:51|
|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.
|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|
|Copyright © 2000 - 2011 MantisBT Group|