X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=ocaml%2Futil.ml;h=05b952651f4691fd47336241c2f5555b1a1b360f;hb=18e8638888e5e47d755a6c7c4bff37a1a6ec026b;hp=a4af2dd2b01d4532657e5c2249c571a7f989be23;hpb=e4aa4a66dd0a4946607245a0f43eab803f2770c4;p=fireball-separation.git diff --git a/ocaml/util.ml b/ocaml/util.ml index a4af2dd..05b9526 100644 --- a/ocaml/util.ml +++ b/ocaml/util.ml @@ -14,6 +14,11 @@ let option_map f = function | Some x -> Some (f x) ;; +let option_get = function + | Some x -> x + | None -> failwith "option_get: None" +;; + let rec find_opt f = function [] -> None @@ -108,6 +113,7 @@ let var_of_string s = let print_name l n = if n = -1 then "*" + else if n < 0 then "c" ^ string_of_int n else if n >= List.length l then "x" ^ string_of_int (List.length l - n - 1) else List.nth l n end