Skip to content

Commit

Permalink
wip: fix retrocompat issues in cclist
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Dec 4, 2018
1 parent ef8d19a commit 6a90cb2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
3 changes: 0 additions & 3 deletions src/core/CCArray.mli
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ val reverse_in_place : 'a t -> unit
(** [reverse_in_place a] reverses the array [a] in place. *)

val sorted : ('a -> 'a -> int) -> 'a t -> 'a array
(* FIXME: better label this ~cmp ?? *)
(** [sorted f a] makes a copy of [a] and sorts it with [f].
@since 1.0 *)

val sort_indices : ('a -> 'a -> int) -> 'a t -> int array
(* FIXME: better label this ~cmp ?? *)
(** [sort_indices f a] returns a new array [b], with the same length as [a],
such that [b.(i)] is the index at which the [i]-th element of [sorted f a]
appears in [a]. [a] is not modified.
Expand All @@ -125,7 +123,6 @@ val sort_indices : ('a -> 'a -> int) -> 'a t -> int array
@since 1.0 *)

val sort_ranking : ('a -> 'a -> int) -> 'a t -> int array
(* FIXME: better label this ~cmp ?? *)
(** [sort_ranking f a] returns a new array [b], with the same length as [a],
such that [b.(i)] is the index at which the [i]-th element of [a] appears
in [sorted f a]. [a] is not modified.
Expand Down
3 changes: 0 additions & 3 deletions src/core/CCArrayLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ val reverse_in_place : 'a t -> unit
(** [reverse_in_place a] reverses the array [a] in place. *)

val sorted : f:('a -> 'a -> int) -> 'a t -> 'a array
(* FIXME: better label this ~cmp ?? *)
(** [sorted ~f a] makes a copy of [a] and sorts it with [~f].
@since 1.0 *)

val sort_indices : f:('a -> 'a -> int) -> 'a t -> int array
(* FIXME: better label this ~cmp ?? *)
(** [sort_indices ~f a] returns a new array [b], with the same length as [a],
such that [b.(i)] is the index at which the [i]-th element of [sorted ~f a]
appears in [a]. [a] is not modified.
Expand All @@ -123,7 +121,6 @@ val sort_indices : f:('a -> 'a -> int) -> 'a t -> int array
@since 1.0 *)

val sort_ranking : f:('a -> 'a -> int) -> 'a t -> int array
(* FIXME: better label this ~cmp ?? *)
(** [sort_ranking ~f a] returns a new array [b], with the same length as [a],
such that [b.(i)] is the index at which the [i]-th element of [a] appears
in [sorted ~f a]. [a] is not modified.
Expand Down
9 changes: 4 additions & 5 deletions src/core/CCList.mli
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option
(** [find_idx p x] returns [Some (i,x)] where [x] is the [i]-th element of [l],
and [p x] holds. Otherwise returns [None]. *)

val remove : eq:('a -> 'a -> bool) -> 'a -> 'a t -> 'a t
val remove : eq:('a -> 'a -> bool) -> key:'a -> 'a t -> 'a t
(* FIXME: the original CCList.mli uses ~x instead of ~key !! *)
(** [remove key l] removes every instance of [key] from [l]. Tail-recursive.
(** [remove ~key l] removes every instance of [key] from [l]. Tail-recursive.
@param eq equality function.
@since 0.11 *)

Expand Down Expand Up @@ -589,9 +589,8 @@ module Assoc : sig
@since 0.16 *)

val update :
eq:('a->'a->bool) -> ('b option -> 'b option) -> 'a -> ('a,'b) t -> ('a,'b) t
(* FIXME: the original no labels mli kept the ~f label ! *)
(** [update k f l] updates [l] on the key [k], by calling [f (get l k)]
eq:('a->'a->bool) -> f:('b option -> 'b option) -> 'a -> ('a,'b) t -> ('a,'b) t
(** [update k ~f l] updates [l] on the key [k], by calling [f (get l k)]
and removing [k] if it returns [None], mapping [k] to [v'] if it
returns [Some v'].
@since 0.16 *)
Expand Down
5 changes: 2 additions & 3 deletions src/core/CCListLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) option
(** [find_idx p x] returns [Some (i,x)] where [x] is the [i]-th element of [l],
and [p x] holds. Otherwise returns [None]. *)

val remove : eq:(('a -> 'a -> bool) [@keep_label]) -> key:'a -> 'a t -> 'a t
val remove : eq:(('a -> 'a -> bool) [@keep_label]) -> key:('a [@keep_label]) -> 'a t -> 'a t
(* FIXME: the original CCList.mli uses ~x instead of ~key !! *)
(** [remove ~key l] removes every instance of [key] from [l]. Tail-recursive.
@param eq equality function.
Expand Down Expand Up @@ -587,8 +587,7 @@ module Assoc : sig
@since 0.16 *)

val update :
eq:(('a->'a->bool) [@keep_label]) -> f:('b option -> 'b option) -> 'a -> ('a,'b) t -> ('a,'b) t
(* FIXME: the original no labels mli kept the ~f label ! *)
eq:(('a->'a->bool) [@keep_label]) -> f:(('b option -> 'b option) [@keep_label]) -> 'a -> ('a,'b) t -> ('a,'b) t
(** [update k ~f l] updates [l] on the key [k], by calling [f (get l k)]
and removing [k] if it returns [None], mapping [k] to [v'] if it
returns [Some v'].
Expand Down

0 comments on commit 6a90cb2

Please sign in to comment.