... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    ["[0]" text (.only \n)
     ["%" \\injection]]]
   [meta
    ["[0]" code]]]]
 [\\library
  ["[0]" /]])

(the .public documentation
  (.List $.Documentation)
  (list ($.module /._
                  "")

        ($.definition /.nominal)
        ($.definition /.equivalence)
        ($.definition /.monoid)
        ($.definition /.functor)
        ($.definition /.mix)
        ($.definition /.every?)
        ($.definition /.any?)

        ($.definition (/.Array it)
          "Mutable arrays.")

        ($.definition /.empty
          "An empty array of the specified size."
          ($.example (' (empty size))))

        ($.definition /.size
          ""
          ($.example (' (size array))))

        ($.definition /.item
          ""
          ($.example (' (item index array))))

        ($.definition /.has!
          "Mutate the array by writing a value to the specified index."
          ($.example (' (has! index value array))))

        ($.definition /.lacks!
          "Mutate the array by deleting the value at the specified index."
          ($.example (' (lacks! index array))))

        ($.definition /.has?
          ""
          ($.example (' (has? index array))))

        ($.definition /.revised!
          "Mutate the array by updating the value at the specified index."
          ($.example (' (revised! index transform array))))

        ($.definition /.upsert!
          (%.message "Mutate the array by updating the value at the specified index."
                     \n "If there is no value, update and write the default value given.")
          ($.example (' (upsert! index default transform array))))

        ($.definition /.copy!
          "Writes the contents of one array into the other."
          ($.example (' (copy! length src_start src_array dest_start dest_array))))

        ($.definition /.occupancy
          "Finds out how many cells in an array are occupied."
          ($.example (' (occupancy array))))

        ($.definition /.vacancy
          "Finds out how many cells in an array are vacant."
          ($.example (' (vacancy array))))

        ($.definition /.only!
          "Delete every item of the array that fails to satisfy the predicate."
          ($.example (' (only! p xs))))

        ($.definition /.example
          "Yields the first item in the array that satisfies the predicate."
          ($.example (' (example p xs))))

        ($.definition /.example'
          "Just like 'example', but with access to the index of each value."
          ($.example (' (example' p xs))))

        ($.definition /.clone
          "Yields a shallow clone of the array."
          ($.example (' (clone xs))))

        ($.definition /.of_list
          ""
          ($.example (' (of_list xs))))

        ($.definition /.list
          (%.message "Yields a list with every non-empty item in the array."
                     \n "Can use the optional default value when encountering an empty cell in the array.")
          ($.example (' (list {.#None} array)))
          ($.example (' (list {.#Some default} array))))
        ))
