small changes related to docs of sorted_diff_uniq

This commit is contained in:
Simon Cruanes 2021-05-25 19:16:37 -04:00 committed by GitHub
parent 1c6bc16362
commit f7a2edae25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -979,6 +979,7 @@ let sorted_diff_uniq ~cmp l1 l2 =
(*$T (*$T
sorted_diff_uniq ~cmp:CCInt.compare [1; 1; 1; 2; 2; 3; 5; 8; 8; 8] [1; 2; 2; 2; 2; 8; 13; 13; 13] = [1;3;5;8] sorted_diff_uniq ~cmp:CCInt.compare [1; 1; 1; 2; 2; 3; 5; 8; 8; 8] [1; 2; 2; 2; 2; 8; 13; 13; 13] = [1;3;5;8]
sorted_diff_uniq ~cmp:CCInt.compare [1;1;1;2;2] [1;2;2;2] = [1;1]
*) *)
(*$Q (*$Q

View file

@ -530,7 +530,7 @@ val sorted_diff_uniq : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
and then remove duplicates. and then remove duplicates.
Both lists are assumed to be sorted with respect to [cmp] and Both lists are assumed to be sorted with respect to [cmp] and
duplicate elements in the input lists are treated individually; duplicate elements in the input lists are treated individually;
for example, [sorted_diff_uniq ~cmp [1;1;1;2;2] [1;2;2;2]] would be [[1]]. for example, [sorted_diff_uniq ~cmp [1;1;1;2;2] [1;2;2;2]] would be [[1;1]].
[sorted_diff_uniq ~cmp l1 l2] and [uniq_succ ~eq (sorted_diff ~cmp l1 l2)] [sorted_diff_uniq ~cmp l1 l2] and [uniq_succ ~eq (sorted_diff ~cmp l1 l2)]
always give the same result for sorted [l1] and [l2] and compatible [cmp] and [eq]. always give the same result for sorted [l1] and [l2] and compatible [cmp] and [eq].
@since NEXT_RELEASE *) @since NEXT_RELEASE *)

View file

@ -533,7 +533,7 @@ val sorted_diff_uniq : cmp:(('a -> 'a -> int) [@keep_label]) -> 'a list -> 'a li
and then remove duplicates. and then remove duplicates.
Both lists are assumed to be sorted with respect to [cmp] and Both lists are assumed to be sorted with respect to [cmp] and
duplicate elements in the input lists are treated individually; duplicate elements in the input lists are treated individually;
for example, [sorted_diff_uniq ~cmp [1;1;1;2;2] [1;2;2;2]] would be [[1]]. for example, [sorted_diff_uniq ~cmp [1;1;1;2;2] [1;2;2;2]] would be [[1;1]].
[sorted_diff_uniq ~cmp l1 l2] and [uniq_succ ~eq (sorted_diff ~cmp l1 l2)] [sorted_diff_uniq ~cmp l1 l2] and [uniq_succ ~eq (sorted_diff ~cmp l1 l2)]
always give the same result for sorted [l1] and [l2] and compatible [cmp] and [eq]. always give the same result for sorted [l1] and [l2] and compatible [cmp] and [eq].
@since NEXT_RELEASE *) @since NEXT_RELEASE *)