package containers-data
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=1e7992cb2e59c0d2290d1b6c3a31531b3f310be6170b8ef3dde17ccd876b5b79
sha512=bb124e69ad0690f88393e18eee499be07761e767593558867aab32f643466b43258ced503170b154ca3b56dbd68987abd6d9438cf473707ec9866511589a5b84
doc/containers-data/CCImmutArray/index.html
Module CCImmutArraySource
Immutable Arrays
Purely functional use of arrays. Update is costly, but reads are very fast. Sadly, it is not possible to make this type covariant without using black magic.
Array of values of type 'a. The underlying type really is an array, but it will never be modified.
It should be covariant but OCaml will not accept it.
sub a start len returns a fresh array of length len, containing the elements from start to pstart + len - 1 of array a.
Raises Invalid_argument "Array.sub" if start and len do not designate a valid subarray of a; that is, if start < 0, or len < 0, or start + len > Array.length a.
Conversions
Take ownership of the given array. Careful, the array must NOT be modified afterwards!
IO
val pp :
?pp_start:unit printer ->
?pp_stop:unit printer ->
?pp_sep:unit printer ->
'a printer ->
'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf a formats the array a on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").