[sledge] Add Vector.unzip

Reviewed By: jvillard

Differential Revision: D16905895

fbshipit-source-id: 98891d4b0
master
Josh Berdine 5 years ago committed by Facebook Github Bot
parent 0790a64763
commit 2c9fce0bf2

@ -81,5 +81,10 @@ let of_list x = v (Array.of_list x)
let of_list_rev x = v (Array.of_list_rev x)
let of_option x = v (Option.to_array x)
let reduce_exn x ~f = Array.reduce_exn (a x) ~f
let unzip x =
let y, z = Array.unzip (a x) in
(v y, v z)
let to_list x = Array.to_list (a x)
let to_array = a

@ -175,7 +175,9 @@ val reduce_exn : 'a t -> f:('a -> 'a -> 'a) -> 'a
(* val random_element_exn : ?random_state:Base.Random.State.t -> 'a t -> 'a *)
(* val zip : 'a t -> 'b t -> ('a * 'b) t option *)
(* val zip_exn : 'a t -> 'b t -> ('a * 'b) t *)
(* val unzip : ('a * 'b) t -> 'a t * 'b t *)
val unzip : ('a * 'b) t -> 'a t * 'b t
(* val sorted_copy : 'a t -> compare:('a -> 'a -> int) -> 'a t *)
(* val last : 'a t -> 'a *)

Loading…
Cancel
Save