... 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 local)
   ["$" documentation]]]
 [\\library
  ["[0]" /]])

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

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

        ($.definition (/.State state it)
          "Stateful computations.")

        ($.definition /.get
          "Read the current state.")

        ($.definition /.put
          "Set the new state."
          ($.example (' (put new_state))))

        ($.definition /.update
          "Compute the new state."
          ($.example (' (update change))))

        ($.definition /.use
          "Run a function on the current state."
          ($.example (' (use user))))

        ($.definition /.local
          "Run the computation with a locally-modified state."
          ($.example (' (local change action))))

        ($.definition /.value
          "Run a stateful computation."
          ($.example (' (value state action))))

        ($.definition /.while
          "A stateful while loop."
          ($.example (' (while condition body))))

        ($.definition /.do_while
          "A stateful do-while loop."
          ($.example (' (do_while condition body))))

        ($.definition /.With
          "Stateful computations decorated by a monad.")

        ($.definition /.value'
          "Execute a stateful computation decorated by a monad."
          ($.example (' (value' state action))))

        ($.definition /.with
          "A monad transformer to create composite stateful computations."
          ($.example (' (with monad))))

        ($.definition /.lifted
          "Lift monadic values to the With wrapper."
          ($.example (' (lifted monad ma))))
        ))
