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

    Holds immutable lists of 32-bit integers. A list is the empty list, or a head in front of a tail that is a list of the same pool. The pool gives equal lists the same id, so two lists are equal when their ids are equal, and lists that end alike share their tails. A stack is such a list, and so is each half of a tape.

    cons takes constant expected time. head, tail and length take constant time. A pool with a budget charges one Resource.Cells for each new list.

    Index
    empty: number = 0

    The id of the empty list.

    • get size(): number

      The number of distinct lists, with the empty list.

      Returns number

    • Returns the list that has head in front of the list tail.

      Parameters

      • head: number
      • tail: number

      Returns number

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

      Parameters

      • list: number

      Returns number

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

      Parameters

      • list: number

      Returns number

    • Returns the number of items of a list.

      Parameters

      • list: number

      Returns number

    • Yields the items of a list from its head to its end.

      Parameters

      • list: number

      Returns IterableIterator<number>