Below is the API for the OCaml standard library. It's directly copied over from the OCaml Manual, formatted to the Reason syntax and styled accordingly. The API docs are work-in-progress; we'll be polishing these gradually!
If you're targeting JavaScript, the API docs for BuckleScript includes all of below, plus JS-specific APIs.
module Array1: sig .. endArray1 structure provides operations
similar to those of
Bigarray.Genarray, but specialized to the case of one-dimensional arrays.
(The Array2 and Array3 structures below provide operations
specialized for two- and three-dimensional arrays.)
Statically knowing the number of dimensions of the array allows
faster operations, and more precise static type-checking.type ('a, 'b, 'c) t
'a, representation kind 'b, and memory layout 'c.val create : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> int -> ('a, 'b, 'c) tArray1.create kind layout dim returns a new bigarray of
one dimension, whose size is dim. kind and layout
determine the array element kind and the array layout
as described for Genarray.create.val dim : ('a, 'b, 'c) t -> intval kind : ('a, 'b, 'c) t -> ('a, 'b) Bigarray.kindval layout : ('a, 'b, 'c) t -> 'c Bigarray.layoutval get : ('a, 'b, 'c) t -> int -> 'aArray1.get a x, or alternatively a.{x},
returns the element of a at index x.
x must be greater or equal than 0 and strictly less than
Array1.dim a if a has C layout. If a has Fortran layout,
x must be greater or equal than 1 and less or equal than
Array1.dim a. Otherwise, Invalid_argument is raised.val set : ('a, 'b, 'c) t -> int -> 'a -> unitArray1.set a x v, also written a.{x} <- v,
stores the value v at index x in a.
x must be inside the bounds of a as described in
Bigarray.Array1.get;
otherwise, Invalid_argument is raised.val sub : ('a, 'b, 'c) t -> int -> int -> ('a, 'b, 'c) tGenarray.sub_left for more details.val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unitGenarray.blit for more details.val fill : ('a, 'b, 'c) t -> 'a -> unitGenarray.fill for more details.val of_array : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a array -> ('a, 'b, 'c) tval map_file : Unix.file_descr -> ?pos:int64 -> ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> bool -> int -> ('a, 'b, 'c) tBigarray.Genarray.map_file for more details.val unsafe_get : ('a, 'b, 'c) t -> int -> 'aBigarray.Array1.get, but bounds checking is not always performed.
Use with caution and only when the program logic guarantees that
the access is within bounds.val unsafe_set : ('a, 'b, 'c) t -> int -> 'a -> unitBigarray.Array1.set, but bounds checking is not always performed.
Use with caution and only when the program logic guarantees that
the access is within bounds.