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

(.def .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."
          [(put new_state)])

        ($.definition /.update
          "Compute the new state."
          [(update change)])

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

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

        ($.definition /.result
          "Run a stateful computation."
          [(result state action)])

        ($.definition /.while
          "A stateful while loop."
          [(while condition body)])

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

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

        ($.definition /.result'
          "Execute a stateful computation decorated by a monad."
          [(result' state action)])

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

        ($.definition /.lifted
          "Lift monadic values to the +State wrapper."
          [(lifted monad ma)])
        ))
