aboutsummaryrefslogtreecommitdiff
path: root/src/boot/util/common.ml
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-07-12 19:39:29 -0700
committerPatrick Walton <[email protected]>2010-07-15 18:27:09 -0700
commitc96f0bf7386081d21b00af4fa7fcf73ac8d79575 (patch)
treec006fa1a8d9d817b3ccf60a3874034dce5975e3d /src/boot/util/common.ml
parentRemove log-type-error; everything is loggable. (diff)
downloadrust-c96f0bf7386081d21b00af4fa7fcf73ac8d79575.tar.xz
rust-c96f0bf7386081d21b00af4fa7fcf73ac8d79575.zip
Implement the "simple typechecker", which avoids HM inference
Diffstat (limited to 'src/boot/util/common.ml')
-rw-r--r--src/boot/util/common.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/boot/util/common.ml b/src/boot/util/common.ml
index 0ea39e2d..3271b644 100644
--- a/src/boot/util/common.ml
+++ b/src/boot/util/common.ml
@@ -341,6 +341,16 @@ let bool_of_option x =
Some _ -> true
| None -> false
+let may f x =
+ match x with
+ Some x' -> f x'
+ | None -> ()
+
+let option_get x =
+ match x with
+ Some x -> x
+ | None -> raise Not_found
+
(*
* Auxiliary stack functions.
*)