Module type Parallel_arrays.Set

type 'a t

To store a value in a parallel array, we must prove that it does not share unsynchronized state with any other elements. This is the case if its type crosses contention or it lives in a fresh capsule.

val set : 'a. 'a t -> Base.int -> 'a -> Base.unit @@ portable

set t i a stores the element a at index i. Raises Invalid_arg if i is not in the range [0..length t).

val unsafe_set : 'a. 'a t -> Base.int -> 'a -> Base.unit @@ portable

unsafe_set t i a unsafely stores the element a at index i.

val insert : 'a t -> Base.int -> (Base.unit -> 'a) @ local once portable -> Base.unit @@ portable

insert t i f stores f () at index i. Raises Invalid_arg if i is not in the range [0..length t).

val unsafe_insert : 'a t -> Base.int -> (Base.unit -> 'a) @ local once portable -> Base.unit @@ portable

unsafe_insert t i f unsafely stores f () at index i.