mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-10 21:23:57 -05:00
Merge remote-tracking branch 'perso/master' into CCHeap
This commit is contained in:
commit
dcd975ce85
4 changed files with 16 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ maintainer: "simon.cruanes.2007@m4x.org"
|
||||||
build: [
|
build: [
|
||||||
["jbuilder" "build" "-p" name "-j" jobs]
|
["jbuilder" "build" "-p" name "-j" jobs]
|
||||||
]
|
]
|
||||||
build-doc: [ "jbuilder" "doc" ]
|
build-doc: [ "jbuilder" "build" "@doc" ]
|
||||||
build-test: [ "jbuilder" "runtest" ]
|
build-test: [ "jbuilder" "runtest" ]
|
||||||
depends: [
|
depends: [
|
||||||
"jbuilder" {build}
|
"jbuilder" {build}
|
||||||
|
|
|
||||||
|
|
@ -855,6 +855,10 @@ let head_opt = function
|
||||||
| [] -> None
|
| [] -> None
|
||||||
| x::_ -> Some x
|
| x::_ -> Some x
|
||||||
|
|
||||||
|
let tail_opt = function
|
||||||
|
| [] -> None
|
||||||
|
| _ :: tail -> Some tail
|
||||||
|
|
||||||
let rec last_opt = function
|
let rec last_opt = function
|
||||||
| [] -> None
|
| [] -> None
|
||||||
| [x] -> Some x
|
| [x] -> Some x
|
||||||
|
|
@ -864,6 +868,9 @@ let rec last_opt = function
|
||||||
(Some 1) (head_opt [1;2;3])
|
(Some 1) (head_opt [1;2;3])
|
||||||
(Some 1) (head_opt [1])
|
(Some 1) (head_opt [1])
|
||||||
None (head_opt [])
|
None (head_opt [])
|
||||||
|
(Some [2;3]) (tail_opt [1;2;3])
|
||||||
|
(Some []) (tail_opt [1])
|
||||||
|
None (tail_opt [])
|
||||||
(Some 3) (last_opt [1;2;3])
|
(Some 3) (last_opt [1;2;3])
|
||||||
(Some 1) (last_opt [1])
|
(Some 1) (last_opt [1])
|
||||||
None (last_opt [])
|
None (last_opt [])
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,10 @@ val head_opt : 'a t -> 'a option
|
||||||
(** First element.
|
(** First element.
|
||||||
@since 0.20 *)
|
@since 0.20 *)
|
||||||
|
|
||||||
|
val tail_opt : 'a t -> 'a t option
|
||||||
|
(** Return the given list without its first element.
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val last_opt : 'a t -> 'a option
|
val last_opt : 'a t -> 'a option
|
||||||
(** Last element.
|
(** Last element.
|
||||||
@since 0.20 *)
|
@since 0.20 *)
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,10 @@ val head_opt : 'a t -> 'a option
|
||||||
(** First element.
|
(** First element.
|
||||||
@since 0.20 *)
|
@since 0.20 *)
|
||||||
|
|
||||||
|
val tail_opt : 'a t -> 'a t option
|
||||||
|
(** Return the given list without its first element.
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val last_opt : 'a t -> 'a option
|
val last_opt : 'a t -> 'a option
|
||||||
(** Last element.
|
(** Last element.
|
||||||
@since 0.20 *)
|
@since 0.20 *)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue