Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005777OCaml~DO NOT USE (was: OCaml general)public2012-10-07 14:322016-12-12 16:50
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version4.00.1 
Target VersionFixed in Version 
Summary0005777: Update mode for inferring mli files
DescriptionSome 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

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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
Bardou (reporter)
2012-10-30 14:42

What about the following example:

type t = int
let f x = x + 1


type t
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.
frisch (developer)
2012-10-30 16:37

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.
hongboz (developer)
2012-10-31 02:42

frisch, I agree with you, how about my proposal?
frisch (developer)
2012-10-31 17:24

> 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.
shinwell (developer)
2016-12-12 16:49

This proposal does not appear to have been well-received in 2012. I move to close this issue.

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker