package containers

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Array.MakeSource

Makes an array given an arbitrary element type

Parameters

module Elt : sig ... end

Signature

Sourcetype elt = Elt.t

The element type

Sourcetype t = Elt.t array

The type of an array instance

Sourceval dummy : elt

A dummy element used for empty slots in the array

  • since 2.4
Sourceval create : int -> t

Make an array of the given size, filled with dummy elements.

Sourceval length : t -> int

length t gets the total number of elements currently in t.

Sourceval get : t -> int -> elt

get t i gets the element at position i.

Sourceval set : t -> int -> elt -> unit

set t i e sets the element at position i to e.

Sourceval sub : t -> int -> int -> t

sub t i len gets the sub-array of t from position i to i + len.

Sourceval copy : t -> t

copy t makes a fresh copy of the array t.

Sourceval blit : t -> int -> t -> int -> int -> unit

blit t s arr i len copies len elements from arr starting at i to position s from t.

Sourceval iter : (elt -> unit) -> t -> unit

iter f t iterates over the array t invoking f with the current element, in array order.

OCaml

Innovation. Community. Security.