diff options
| author | Gaëtan Gilbert | 2018-11-21 19:18:48 +0100 |
|---|---|---|
| committer | Gaëtan Gilbert | 2018-11-23 13:21:31 +0100 |
| commit | 99d129b8e4e7fcde8c848520463c4e8c7d8bdc11 (patch) | |
| tree | afd214c684da385dc2f19048660af8e356281906 | |
| parent | 8fb01564fba587142c2471708ff18219f1c64903 (diff) | |
Goptions.declare_* functions return unit instead of a write_function
Returning a writer insinuates that it is not exactly the same as the
writer which was passed as argument, but that is incorrect.
| -rw-r--r-- | library/goptions.ml | 5 | ||||
| -rw-r--r-- | library/goptions.mli | 10 | ||||
| -rw-r--r-- | tactics/class_tactics.ml | 4 |
3 files changed, 7 insertions, 12 deletions
diff --git a/library/goptions.ml b/library/goptions.ml index 154b863fa1..bb9b4e29fc 100644 --- a/library/goptions.ml +++ b/library/goptions.ml @@ -276,10 +276,7 @@ let declare_option cast uncast append ?(preprocess = fun x -> x) let cread () = cast (read ()) in let cwrite l v = warn (); change l OptSet (uncast v) in let cappend l v = warn (); change l OptAppend (uncast v) in - value_tab := OptionMap.add key (name, depr, (cread,cwrite,cappend)) !value_tab; - write - -type 'a write_function = 'a -> unit + value_tab := OptionMap.add key (name, depr, (cread,cwrite,cappend)) !value_tab let declare_int_option = declare_option diff --git a/library/goptions.mli b/library/goptions.mli index 3d7df18fed..900217e06b 100644 --- a/library/goptions.mli +++ b/library/goptions.mli @@ -122,16 +122,14 @@ type 'a option_sig = { (** The [preprocess] function is triggered before setting the option. It can be used to emit a warning on certain values, and clean-up the final value. *) -type 'a write_function = 'a -> unit - val declare_int_option : ?preprocess:(int option -> int option) -> - int option option_sig -> int option write_function + int option option_sig -> unit val declare_bool_option : ?preprocess:(bool -> bool) -> - bool option_sig -> bool write_function + bool option_sig -> unit val declare_string_option: ?preprocess:(string -> string) -> - string option_sig -> string write_function + string option_sig -> unit val declare_stringopt_option: ?preprocess:(string option -> string option) -> - string option option_sig -> string option write_function + string option option_sig -> unit (** {6 Special functions supposed to be used only in vernacentries.ml } *) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 5959dd54b1..b349accbc9 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -113,7 +113,7 @@ let _ = optread = get_typeclasses_filtered_unification; optwrite = set_typeclasses_filtered_unification; } -let set_typeclasses_debug = +let _ = declare_bool_option { optdepr = false; optname = "debug output for typeclasses proof search"; @@ -137,7 +137,7 @@ let _ = optread = get_typeclasses_verbose; optwrite = set_typeclasses_verbose; } -let set_typeclasses_depth = +let _ = declare_int_option { optdepr = false; optname = "depth for typeclasses proof search"; |
