Module type Parallel_arrays.Map

type 'a t

Mapping functions do not need to be templated over the mode of their output type. To work with a contended or shared 'b, return a 'b Modes.Contended.t or 'b Modes.Shared.t.

val map : Parallel_kernel.t @ local -> ('a t -> (f:(Parallel_kernel.t @ local -> ('a -> 'b) @ local) @ shareable -> 'b t) @ local) @ local

map parallel t ~f initializes an array with the result of f applied to each element of t.

val mapi : Parallel_kernel.t @ local -> ('a t -> (f: (Parallel_kernel.t @ local -> (Base.int -> ('a -> 'b) @ local) @ local) @ shareable -> 'b t) @ local) @ local

mapi parallel t ~f initializes an array with the result of f applied to each element of t and its index.

val map2_exn : Parallel_kernel.t @ local -> ('a t -> ('b t -> (f: (Parallel_kernel.t @ local -> ('a -> ('b -> 'c) @ local) @ local) @ shareable -> 'c t) @ local) @ local) @ local

map2_exn parallel t0 t1 ~f initializes an array with the result of f applied to each pair of elements of t0, t1. Raises if t0 and t1 do not have equal lengths.

val mapi2_exn : Parallel_kernel.t @ local -> ('a t -> ('b t -> (f: (Parallel_kernel.t @ local -> (Base.int -> ('a -> ('b -> 'c) @ local) @ local) @ local) @ shareable -> 'c t) @ local) @ local) @ local

mapi2_exn parallel t0 t1 ~f initializes an array with the result of f applied to each pair of element of t0, t1 and their index. Raises if t0 and t1 do not have equal lengths.