mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
ocamlformat
This commit is contained in:
parent
b140a50c46
commit
cad41d70d6
26 changed files with 89 additions and 92 deletions
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
|
|
@ -68,7 +68,7 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
ocaml-compiler:
|
||||
- '5.1'
|
||||
- '5.2'
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
|
|
@ -79,6 +79,6 @@ jobs:
|
|||
dune-cache: true
|
||||
allow-prerelease-opam: true
|
||||
|
||||
- run: opam install ocamlformat.0.24.1
|
||||
- run: opam install ocamlformat.0.26.2
|
||||
- run: opam exec -- make format-check
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
version = 0.24.1
|
||||
version = 0.26.2
|
||||
profile=conventional
|
||||
margin=80
|
||||
if-then-else=k-r
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ val partition_map :
|
|||
('a -> [< `Left of 'b | `Right of 'c | `Drop ]) ->
|
||||
'a list ->
|
||||
'b list * 'c list
|
||||
[@@ocaml.deprecated "use CCList.partition_filter_map instead"]
|
||||
[@@ocaml.deprecated "use CCList.partition_filter_map instead"]
|
||||
(** @deprecated use {!partition_filter_map} instead
|
||||
@since 0.11 *)
|
||||
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ val partition_map :
|
|||
f:('a -> [< `Left of 'b | `Right of 'c | `Drop ]) ->
|
||||
'a list ->
|
||||
'b list * 'c list
|
||||
[@@ocaml.deprecated "use CCList.partition_filter_map instead"]
|
||||
[@@ocaml.deprecated "use CCList.partition_filter_map instead"]
|
||||
(** @deprecated use {!partition_filter_map} instead *)
|
||||
|
||||
val group_by : ?hash:('a -> int) -> ?eq:('a -> 'a -> bool) -> 'a t -> 'a list t
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ val value : 'a t -> default:'a -> 'a
|
|||
@since 2.8 *)
|
||||
|
||||
val get_exn : 'a t -> 'a
|
||||
[@@ocaml.deprecated "use CCOption.get_exn_or instead"]
|
||||
[@@ocaml.deprecated "use CCOption.get_exn_or instead"]
|
||||
(** [get_exn o] returns [x] if [o] is [Some x] or fails if [o] is [None].
|
||||
@raise Invalid_argument if the option is [None].
|
||||
@deprecated use {!get_exn_or} instead
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ val poly : 'a t
|
|||
@since 3.6 *)
|
||||
|
||||
val compare : 'a t
|
||||
[@@deprecated "use CCOrd.poly instead, this name is too general"]
|
||||
[@@deprecated "use CCOrd.poly instead, this name is too general"]
|
||||
(** Polymorphic "magic" comparison.
|
||||
@deprecated since 3.6 in favor of {!poly}. The reason is that
|
||||
[compare] is easily shadowed, can shadow other comparators, and is just
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ val optional : _ t -> unit t
|
|||
@since 3.6 *)
|
||||
|
||||
val try_ : 'a t -> 'a t
|
||||
[@@deprecated "plays no role anymore, just replace [try foo] with [foo]"]
|
||||
[@@deprecated "plays no role anymore, just replace [try foo] with [foo]"]
|
||||
(** [try_ p] is just like [p] (it used to play a role in backtracking
|
||||
semantics but no more).
|
||||
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ let find_internal_i_ p v =
|
|||
else (
|
||||
let x = v.vec.(i) in
|
||||
if p x then
|
||||
i,x
|
||||
i, x
|
||||
else
|
||||
check (i + 1)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -66,11 +66,10 @@ let rec cut_depth n t () =
|
|||
(** {2 Graph Traversals} *)
|
||||
|
||||
(** Abstract Set structure *)
|
||||
class type ['a] pset =
|
||||
object
|
||||
class type ['a] pset = object
|
||||
method add : 'a -> 'a pset
|
||||
method mem : 'a -> bool
|
||||
end
|
||||
end
|
||||
|
||||
let set_of_cmp (type elt) ~cmp () =
|
||||
let module S = Set.Make (struct
|
||||
|
|
|
|||
|
|
@ -49,11 +49,10 @@ val cut_depth : int -> 'a t -> 'a t
|
|||
(** {2 Graph Traversals} *)
|
||||
|
||||
(** Abstract Set structure *)
|
||||
class type ['a] pset =
|
||||
object
|
||||
class type ['a] pset = object
|
||||
method add : 'a -> 'a pset
|
||||
method mem : 'a -> bool
|
||||
end
|
||||
end
|
||||
|
||||
val set_of_cmp : cmp:('a -> 'a -> int) -> unit -> 'a pset
|
||||
(** Build a set structure given a total ordering. *)
|
||||
|
|
|
|||
|
|
@ -37,9 +37,8 @@ val ( >=. ) : float -> float -> bool
|
|||
(** {2 Shadow Dangerous Operators} *)
|
||||
|
||||
val ( == ) : [ `Consider_using_CCEqual_physical ]
|
||||
[@@ocaml.deprecated "Please use CCEqual.physical or Stdlib.(==) instead."]
|
||||
[@@ocaml.deprecated "Please use CCEqual.physical or Stdlib.(==) instead."]
|
||||
|
||||
val ( != ) : [ `Consider_using_CCEqual_physical ]
|
||||
[@@ocaml.deprecated
|
||||
"Please use [not CCEqual.physical] or Stdlib.(!=) instead."]
|
||||
[@@ocaml.deprecated "Please use [not CCEqual.physical] or Stdlib.(!=) instead."]
|
||||
(** @since 2.1 *)
|
||||
|
|
|
|||
|
|
@ -183,10 +183,11 @@ let arb_csexp_arb =
|
|||
let genstr = Q.Gen.(string_size ~gen:genchar (0 -- 15)) in
|
||||
Q.make ~print:Sexp0.to_string ~shrink:shrink_csexp (gen_csexp genstr)
|
||||
|
||||
module Make (X : sig
|
||||
module Make
|
||||
(X : sig
|
||||
val arb : Csexp.t Q.arbitrary
|
||||
end)
|
||||
() =
|
||||
end)
|
||||
() =
|
||||
struct
|
||||
open X;;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,8 +108,7 @@ let t1 = H.of_list [ 1, "a"; 2, "b1" ] in
|
|||
let t2 = H.of_list [ 2, "b2"; 3, "c" ] in
|
||||
let t =
|
||||
H.merge
|
||||
~f:
|
||||
(fun _ -> function
|
||||
~f:(fun _ -> function
|
||||
| `Right v2 -> Some v2
|
||||
| `Left v1 -> Some v1
|
||||
| `Both (s1, s2) ->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue