(.require
 [library
  [lux (.except if loop)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\format (.only format)]]
    [collection
     ["[0]" list (.use "[1]#[0]" monoid)]]]]]
 [\\library
  ["[0]" /]]
 ["[0]" /
  ["[1][0]" contract]
  ["[1][0]" memo]
  ["[1][0]" mixin]
  ["[1][0]" mutual]
  ["[1][0]" predicate]])

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

                ($.definition /.monoid)

                ($.definition /.identity
                  (format "Identity function."
                          \n "Does nothing to its argument and just returns it.")
                  [(same? (identity value)
                          value)])

                ($.definition /.composite
                  "Function composition."
                  [(= ((composite f g) "foo")
                      (f (g "foo")))])

                ($.definition /.constant
                  "Create constant functions."
                  [(= ((constant "foo") "bar")
                      "foo")])

                ($.definition /.flipped
                  "Flips the order of the arguments of a function."
                  [(= ((flipped f) "foo" "bar")
                      (f "bar" "foo"))])

                ($.definition /.on
                  "Simple 1-argument function application."
                  [(on input function)])

                (all list#composite
                     /contract.documentation
                     /memo.documentation
                     /mixin.documentation
                     /mutual.documentation
                     /predicate.documentation)
                ))
