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

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

        ($.definition /.cannot_represent_value)
        ($.definition /.type_hole)
        ($.definition /.unknown_local_binding)

        ($.definition /.inspection
          "A best-effort attempt to generate a textual representation of a value, without knowing its type."
          [(inspection value)])

        ($.definition /.representation
          "A best-effort attempt to generate a textual representation of a value, while knowing its type."
          [(representation type value)])

        ($.definition /.private
          "Allows access to un-exported definitions in other modules."
          ["Module A"
           (def .private (secret_definition input)
             (-> ??? ???)
             (foo (bar (baz input))))
           "Module B"
           ((/.private secret_definition) my_input)])

        ($.definition /.log!
          "Prints/writes a message to standard output."
          [(log! message)])

        ($.definition /.hole
          (format "A typed 'hole'."
                  \n "Reveals the type expected of the expression that should go in the hole.")
          [(is (-> Nat Text)
               (function (_ number)
                 (hole)))
           "=>"
           .Text])

        ($.definition /.here
          "Shows the names and values of local bindings available around the call to 'here'."
          [(let [foo 123
                 bar +456
                 baz +789.0]
             (is Any
                 (here)))
           "=>"
           "foo: +123"
           "bar: +456"
           "baz: +789.0"
           []]
          ["Can optionally be given a list of definitions to focus on."
           "These definitions to focus on can include custom format to represent the values."
           (let [foo 123
                 bar +456
                 baz +789.0]
             (is Any
                 (here [foo %.nat] baz)))
           "=>"
           "foo: 123"
           "baz: +789.0"
           []])
        ))
