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

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

        ($.definition /.functor)
        ($.definition /.apply)
        ($.definition /.monad)

        ($.definition (/.Thread ! it)
          "An imperative process with access to mutable values.")

        ($.definition (/.Box ! it)
          "A mutable box holding a value.")

        ($.definition /.box
          "A brand-new box initialized to the given value."
          [(box init)])

        ($.definition /.read!
          "Reads the current value in the box."
          [(read! box)])

        ($.definition /.write!
          "Mutates the value in the box."
          [(write! value box)])

        ($.definition /.result
          "Executes the imperative thread in a self-contained way."
          [(result thread)])

        ($.definition /.io
          "Transforms the imperative thread into an I/O computation.")

        ($.definition /.update!
          "Update a box's value by applying a function to it."
          [(update! f box)])
        ))
