... 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
    [text (.only \n)
     ["%" \\injection]]]]]
 [\\library
  ["[0]" /]])

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

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

        ($.definition (/.Region r ! it)
          (%.message "A region where resources may be be claimed and where a side-effecting computation may be performed."
                     \n "Every resource is paired with a function that knows how to clean/reclaim it, to make sure there are no leaks."))

        ($.definition /.value
          "Executes a region-based computation, with a side-effect determined by the monad."
          ($.example (' (value monad computation))))

        ($.definition /.acquire!
          "Acquire a resource while pairing it a function that knows how to reclaim it."
          ($.example (' (acquire! monad cleaner value))))

        ($.definition /.failure
          "Immediately fail with this 'message'."
          ($.example (' (failure monad error))))

        ($.definition /.except
          "Fail by throwing/raising an exception."
          ($.example (' (except monad exception message))))

        ($.definition /.lifted
          "Lift an effectful computation into a region-based computation."
          ($.example (' (lifted monad operation))))
        ))
