TOC Toolkit API - v0.1.0
    Preparing search index...

    Holds immutable sequences of 32-bit integers that grow at the back and shrink at the front. The pool gives equal sequences the same id, so two sequences are equal when their ids are equal. A queue is such a sequence.

    A sequence is kept as a list from its front to its back. So shift, first and length take constant time, and push takes time linear in the length of the sequence. A pool with a budget charges one Resource.Cells for each new list that a push builds, which is at most the length of its result.

    Index
    empty: number

    The id of the empty sequence.

    • Returns the sequence that has item behind the items of sequence.

      Parameters

      • sequence: number
      • item: number

      Returns number

    • Returns a sequence that is not empty without its first item.

      Parameters

      • sequence: number

      Returns number

    • Returns the first item of a sequence that is not empty.

      Parameters

      • sequence: number

      Returns number

    • Returns the number of items of a sequence.

      Parameters

      • sequence: number

      Returns number

    • Yields the items of a sequence from its front to its back.

      Parameters

      • sequence: number

      Returns IterableIterator<number>