diff options
| author | Brian Campbell | 2017-09-04 12:09:59 +0100 |
|---|---|---|
| committer | Brian Campbell | 2017-09-04 12:09:59 +0100 |
| commit | 00cf8533221d2dfa650adcd38ac53943be5bd995 (patch) | |
| tree | 21a34e1f094ecec430798020e046dd3374e6e74c /src/util.mli | |
| parent | 461f3c914b2e767ef3ddb926712845d5442475f3 (diff) | |
| parent | de506ed9f9c290796f159f2b5279589519c2a198 (diff) | |
Merge branch 'experiments' of bitbucket.org:Peter_Sewell/sail into mono-experiments
Diffstat (limited to 'src/util.mli')
| -rw-r--r-- | src/util.mli | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util.mli b/src/util.mli index aa442ada..11588de2 100644 --- a/src/util.mli +++ b/src/util.mli @@ -40,6 +40,11 @@ (* SUCH DAMAGE. *) (**************************************************************************) +(* Last element of a list *) +val last : 'a list -> 'a + +val butlast : 'a list -> 'a list + (** Mixed useful things *) module Duplicate(S : Set.S) : sig type dups = @@ -77,10 +82,8 @@ 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)] *) +(** [option_binop f (Some x) (Some y)] returns [Some (f x y)], + and in all other cases, [option_binop] returns [None]. *) val option_binop : ('a -> 'a -> 'a) -> 'a option -> 'a option -> 'a option (** [option_get_exn exn None] throws the exception [exn], |
