summaryrefslogtreecommitdiff
path: root/src/util.mli
diff options
context:
space:
mode:
authorThomas Bauereiss2017-07-15 18:29:45 +0100
committerThomas Bauereiss2017-07-15 18:57:55 +0100
commit0a3d703f8180cb0163a6e0d26f0bce198ae221db (patch)
tree15b5900710945cf92ffbed073c52af954e6b3e12 /src/util.mli
parentc63f9086a721c902c2b5c170758c7c63f02330f8 (diff)
Add version of rewriter for new typechecker
Diffstat (limited to 'src/util.mli')
-rw-r--r--src/util.mli6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.mli b/src/util.mli
index 099839bb..cfd6a19e 100644
--- a/src/util.mli
+++ b/src/util.mli
@@ -77,6 +77,12 @@ val option_bind : ('a -> 'b option) -> 'a option -> 'b option
whereas [option_default d (Some x)] returns [x]. *)
val option_default : 'a -> 'a option -> 'a
+(** [option_binop f None None] returns [None], while
+ [option_binop f (Some x) None] and [option_binop f None (Some x)]
+ return [Some x], and [option_binop f (Some x) (Some y)] returns
+ [Some (f x y)] *)
+val option_binop : ('a -> 'a -> 'a) -> 'a option -> 'a option -> 'a option
+
(** [option_get_exn exn None] throws the exception [exn],
whereas [option_get_exn exn (Some x)] returns [x]. *)
val option_get_exn : exn -> 'a option -> 'a