... 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 if loop)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\injection]]
    [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]])

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

                ($.definition /.monoid)

                ($.definition /.identity
                  (%.message "Identity function."
                             \n "Does nothing to its argument and just returns it.")
                  ($.example (' (same? (identity value)
                                       value))))

                ($.definition /.composite
                  "Function composition."
                  ($.example (' (= ((composite f g) "foo")
                                   (f (g "foo"))))))

                ($.definition /.constant
                  "Create constant functions."
                  ($.example (' (= ((constant "foo") "bar")
                                   "foo"))))

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

                ($.definition /.on
                  "Simple 1-argument function application."
                  ($.example (' (on input function))))

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