You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(** [partition f a] split array into tuple of two arrays based on predicate f; first of tuple where predicate vause true, second where predicate cause false
417
419
418
420
@example {[
419
-
predicate (fun x -> if x mod 2 = 0) [|1;2;3;4;5|] = ([|2;4|], [|1;2;3|]);;
420
-
predicate (fun x -> if x mod 2 <> 0) [|1;2;3;4;5|] = ([|1;2;3|], [|2;4|]);;
421
+
predicate [|1;2;3;4;5|] (fun x -> if x mod 2 = 0) = ([|2;4|], [|1;2;3|]);;
422
+
predicate [|1;2;3;4;5|] (fun x -> if x mod 2 <> 0) = ([|1;2;3|], [|2;4|]);;
0 commit comments