diff options
| author | Thomas Bauereiss | 2017-07-15 18:29:45 +0100 |
|---|---|---|
| committer | Thomas Bauereiss | 2017-07-15 18:57:55 +0100 |
| commit | 0a3d703f8180cb0163a6e0d26f0bce198ae221db (patch) | |
| tree | 15b5900710945cf92ffbed073c52af954e6b3e12 /src/util.mli | |
| parent | c63f9086a721c902c2b5c170758c7c63f02330f8 (diff) | |
Add version of rewriter for new typechecker
Diffstat (limited to 'src/util.mli')
| -rw-r--r-- | src/util.mli | 6 |
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 |
