package metapp

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

Indexed accumulator to build an array.

type 'a t

An accumulator of type 'a t can accumulate values of type 'a to build an 'a array.

val empty : 'a t

The empty accumulator.

val add : 'a -> 'a t -> int * 'a t

add v a returns (i, a') where a' is the accumulator a followed by the value v. i is the index of v in a' (and is equal to the length of a).

val length : 'a t -> int

length a returns the length of the accumulator a (the number of elements).

val to_array : 'a t -> 'a array

to_array a returns the array containing all the elements of a.

OCaml

Innovation. Community. Security.