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

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

        ($.definition (/.Capability brand input output)
          (format "Represents the capability to perform an operation."
                  \n "This operation is assumed to have security implications."))

        ($.definition /.use
          "Applies a capability against its required input."
          [(use capability input)])

        ($.definition /.capability
          "Defines a capability as a unique type, and a constructor for instances."
          [(capability (Can_Duplicate a)
             (can_duplicate a [a a]))
           
           (let [capability (can_duplicate
                             (function (_ value)
                               [value value]))
                 [left right] (..use capability 123)]
             (same? left right))])

        ($.definition /.async
          "Converts a synchronous I/O-based capability into an asynchronous capability."
          [(async capability)])
        ))
