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

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

        ($.definition /.atom)
        ($.definition /.read!)

        ($.definition (/.Atom it)
          "Atomic references that are safe to mutate concurrently.")

        ($.definition /.compare_and_swap!
          (format "Only mutates an atom if you can present its current value."
                  \n "That guarantees that atom was not updated since you last read from it."))

        ($.definition /.update!
          (format "Updates an atom by applying a function to its current value."
                  \n "If it fails to update it (because some other process wrote to it first), it will retry until it succeeds."
                  \n "The retries will be done with the new values of the atom, as they show up."))

        ($.definition /.write!
          (format "Writes the given value to an atom."
                  \n "If it fails to write it (because some other process wrote to it first), it will retry until it succeeds."))
        ))
