API / JavaScript / Js / Array

Array

Provide bindings to JS array. Optimized for pipe-last.

type t('a) = array('a);
type array_like('a) = Js_array2.array_like('a);
let from: array_like('a) => array('b);
let fromMap: (array_like('a), 'a => 'b) => array('b);
let isArray: 'a => bool;
let length: array('a) => int;
let copyWithin: (~to_: int, t('a)) => t('a);
let copyWithinFrom: (~to_: int, ~from: int, t('a)) => t('a);
let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t('a)) => t('a);
let fillInPlace: ('a, t('a)) => t('a);
let fillFromInPlace: ('a, ~from: int, t('a)) => t('a);
let fillRangeInPlace: ('a, ~start: int, ~end_: int, t('a)) => t('a);
let pop: t('a) => option('a);
let push: ('a, t('a)) => int;
let pushMany: (array('a), t('a)) => int;
let reverseInPlace: t('a) => t('a);
let shift: t('a) => option('a);
let sortInPlace: t('a) => t('a);
let sortInPlaceWith: (('a, 'a) => int, t('a)) => t('a);
let spliceInPlace: (~pos: int, ~remove: int, ~add: array('a), t('a)) => t('a);
let removeFromInPlace: (~pos: int, t('a)) => t('a);
let removeCountInPlace: (~pos: int, ~count: int, t('a)) => t('a);
let unshift: ('a, t('a)) => int;
let unshiftMany: (array('a), t('a)) => int;
let append: ('a, t('a)) => t('a);
let concat: (t('a), t('a)) => t('a);
let concatMany: (array(t('a)), t('a)) => t('a);
let includes: ('a, t('a)) => bool;
let indexOf: ('a, t('a)) => int;
let indexOfFrom: ('a, ~from: int, t('a)) => int;
let join: t('a) => string;
let joinWith: (string, t('a)) => string;
let lastIndexOf: ('a, t('a)) => int;
let lastIndexOfFrom: ('a, ~from: int, t('a)) => int;
let lastIndexOf_start: ('a, t('a)) => int;
let slice: (~start: int, ~end_: int, t('a)) => t('a);
let copy: t('a) => t('a);
let slice_copy: (unit, t('a)) => t('a);
let sliceFrom: (int, t('a)) => t('a);
let slice_start: (int, t('a)) => t('a);
let toString: t('a) => string;
let toLocaleString: t('a) => string;
let every: ('a => bool, t('a)) => bool;
let everyi: (('a, int) => bool, t('a)) => bool;
let filter: ('a => bool, t('a)) => t('a);
let filteri: (('a, int) => bool, t('a)) => t('a);
let find: ('a => bool, t('a)) => option('a);
let findi: (('a, int) => bool, t('a)) => option('a);
let findIndex: ('a => bool, t('a)) => int;
let findIndexi: (('a, int) => bool, t('a)) => int;
let forEach: ('a => unit, t('a)) => unit;
let forEachi: (('a, int) => unit, t('a)) => unit;
let map: ('a => 'b, t('a)) => t('b);
let mapi: (('a, int) => 'b, t('a)) => t('b);
let reduce: (('b, 'a) => 'b, 'b, t('a)) => 'b;
let reducei: (('b, 'a, int) => 'b, 'b, t('a)) => 'b;
let reduceRight: (('b, 'a) => 'b, 'b, t('a)) => 'b;
let reduceRighti: (('b, 'a, int) => 'b, 'b, t('a)) => 'b;
let some: ('a => bool, t('a)) => bool;
let somei: (('a, int) => bool, t('a)) => bool;
let unsafe_get: (array('a), int) => 'a;
let unsafe_set: (array('a), int, 'a) => unit;