mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
add CCOpt.is_none
This commit is contained in:
parent
262a2baacc
commit
7e5161f94f
2 changed files with 7 additions and 1 deletions
|
|
@ -40,6 +40,10 @@ let is_some = function
|
||||||
| None -> false
|
| None -> false
|
||||||
| Some _ -> true
|
| Some _ -> true
|
||||||
|
|
||||||
|
let is_none = function
|
||||||
|
| None -> true
|
||||||
|
| Some _ -> false
|
||||||
|
|
||||||
let compare f o1 o2 = match o1, o2 with
|
let compare f o1 o2 = match o1, o2 with
|
||||||
| None, None -> 0
|
| None, None -> 0
|
||||||
| Some _, None -> 1
|
| Some _, None -> 1
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,9 @@ val maybe : ('a -> 'b) -> 'b -> 'a t -> 'b
|
||||||
|
|
||||||
val is_some : _ t -> bool
|
val is_some : _ t -> bool
|
||||||
|
|
||||||
|
val is_none : _ t -> bool
|
||||||
|
(** @since NEXT_RELEASE *)
|
||||||
|
|
||||||
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
|
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
|
||||||
|
|
||||||
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
||||||
|
|
@ -62,7 +65,6 @@ val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
|
||||||
|
|
||||||
val filter : ('a -> bool) -> 'a t -> 'a t
|
val filter : ('a -> bool) -> 'a t -> 'a t
|
||||||
(** Filter on 0 or 1 elements
|
(** Filter on 0 or 1 elements
|
||||||
|
|
||||||
@since 0.5 *)
|
@since 0.5 *)
|
||||||
|
|
||||||
val get : 'a -> 'a t -> 'a
|
val get : 'a -> 'a t -> 'a
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue