]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/registry/helm_registry.mli
- added sample usage of get_opt method
[helm.git] / helm / ocaml / registry / helm_registry.mli
index e1c0289a511c85eb127e1664fc1a0ac6187ff296..1f40b5453fa0e352b859e352b41b4b9426d53c23 100644 (file)
@@ -133,6 +133,12 @@ val set_string_list:  key:string -> value:string list -> unit
  * set_* function above. Returned value is a get (set) function typed as the
  * given getter (setter) whith optional values. None is returned for missing
  * keys and None can be assigned to a key removing it from the registry.
+ *
+ * Sample  usage:
+ *
+ *  match Helm_registry.get_opt Helm_registry.get_int "foo.bar" with
+ *  | Some i -> ...
+ *  | None -> ...
  *)
 
 val get_opt:
@@ -141,6 +147,8 @@ val get_opt:
 val set_opt:
   (key:string -> value:'a -> unit) (* setter *) ->
     key:string -> value:'a option -> unit
+val get_opt_default:  (* as get_opt with an additional default value *)
+  (string -> 'a) -> 'a -> string -> 'a
 
 (** {2 Validators}
  * Each key may have zero or more associated validators, that are predicates