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

(the .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."
          ($.example (' (inspection value))))

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

        ($.definition /.private
          "Allows access to un-exported definitions in other modules."

          ($.comment "Module A")
          ($.example (' (the .private (secret_definition input)
                          (-> ??? ???)
                          (foo (bar (baz input))))))
          
          ($.comment "Module B")
          ($.example (' ((/.private secret_definition) my_input))))

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

        ($.definition /.hole
          (%.message "A typed 'hole'."
                     \n "Reveals the type expected of the expression that should go in the hole.")
          ($.example (' (is (-> Natural Text)
                            (function (_ number)
                              (hole)))))
          ($.comment "=>")
          ($.example (' .Text)))

        ($.definition /.here
          "Shows the names and values of local bindings available around the call to 'here'."

          ($.example (' (let [foo 123
                              bar +456
                              baz +789.0]
                          (is Any
                              (here)))))
          ($.comment "=>")
          ($.comment "foo: +123")
          ($.comment "bar: +456")
          ($.comment "baz: +789.0")
          ($.example (' []))
          
          ($.comment "Can optionally be given a list of definitions to focus on.")
          ($.comment "These definitions to focus on can include custom format to represent the values.")
          ($.example (' (let [foo 123
                              bar +456
                              baz +789.0]
                          (is Any
                              (here [foo %.natural] baz)))))
          ($.comment "=>")
          ($.comment "foo: 123")
          ($.comment "baz: +789.0")
          ($.example (' [])))
        ))
