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

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

        ($.definition /.reset)
        ($.definition /.shift)
        ($.definition /.functor)
        ($.definition /.apply)
        ($.definition /.monad)
        ($.definition /.portal)

        ($.definition (/.Cont input output)
          "Continuations.")

        ($.definition /.continued
          "Continues a continuation thunk."
          ($.example (' (continued next cont))))

        ($.definition /.value
          "Forces a continuation thunk to be evaluated."
          ($.example (' (value cont))))

        ($.definition /.with_current
          "Call with current continuation."
          ($.example (' (with_current
                          (function (_ go)
                            (do /.monad
                              [.let [nexus (function (nexus val)
                                             (go [nexus val]))]
                               _ (go [nexus init])]
                              (in (undefined))))))))

        ($.definition /.pending
          "Turns any expression into a function that is pending a continuation."
          ($.example (' (pending (some_function some_input)))))
        ))
