Module Loko.Array

val map : ( 'S, 'F, 'G, 'T ) optic -> ( 'S Stdlib.Array.t, 'F Stdlib.Array.t, 'G Stdlib.Array.t, 'T Stdlib.Array.t ) optic

An isomorphism between arrays.

let [|4; 2|] = L.view (L.Array.map (L.accept ((<) 0))) [|4; -3; 2|]
val elems : ( 'F Stdlib.Array.t, 'F, 'G, 'G Stdlib.Array.t ) optic

A traversal over the removable elements of an array.

val to_list : ( 'F Stdlib.Array.t, 'F list, 'G list, 'G Stdlib.Array.t ) optic

Isomorphism between arrays and lists.

val to_option : ( 'F Stdlib.Array.t, 'F option, 'G option, 'G Stdlib.Array.t ) optic

Isomorphism between singleton arrays and options.

val at : int -> ( 'F Stdlib.Array.t, 'F, 'F, 'F Stdlib.Array.t ) optic

A traversal focusing on a removable element at given index of a list.

let [|3; 1; 4|] = L.over (L.Array.at 2) ((+) 1) [|3; 1; 3|]
let [|4; 2|] = L.remove (L.Array.at 2) [|4; 2; 1|]
val at_ref : int Stdlib.ref -> ( 'F Stdlib.Array.t, 'F, 'F, 'F Stdlib.Array.t ) optic

A traversal focusing on a removable element at a mutable index of a list.