From c96f0bf7386081d21b00af4fa7fcf73ac8d79575 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 12 Jul 2010 19:39:29 -0700 Subject: Implement the "simple typechecker", which avoids HM inference --- src/boot/util/common.ml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/boot/util') 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. *) -- cgit v1.2.3