Skip to content

Commit b716cfe

Browse files
authored
fix partition example
1 parent 5e49799 commit b716cfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jscomp/others/belt_Array.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ val partition : 'a array -> ('a -> bool) -> 'a array * 'a array
462462
(** [partition f a] split array into tuple of two arrays based on predicate f; first of tuple where predicate cause true, second where predicate cause false
463463
464464
@example {[
465-
predicate [|1;2;3;4;5|] (fun x -> if x mod 2 = 0) = ([|2;4|], [|1;2;3|]);;
466-
predicate [|1;2;3;4;5|] (fun x -> if x mod 2 <> 0) = ([|1;2;3|], [|2;4|]);;
465+
partition [|1;2;3;4;5|] (fun x -> if (x mod 2) = 0 then true else false) = ([|2;4|], [|1;2;3|]);;
466+
partition [|1;2;3;4;5|] (fun x -> if (x mod 2) <> 0 then true else false) = ([|1;2;3|], [|2;4|]);;
467467
]}
468468
*)
469469

0 commit comments

Comments
 (0)