... 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
    [text
     ["%" \\injection]]
    [collection
     ["[0]" list]]]
   [meta
    ["[0]" code]
    [macro
     ["[0]" template]]]]]
 [\\library
  ["[0]" /]])

(`` (the .public documentation
      (List $.Documentation)
      (let [literal (list (,, (template.with [<name> <type>]
                                [($.definition <name>
                                   (code.as_text (' (<name>
                                                     (is <type>
                                                         (value generating expression))))))]

                                [/.natural .Natural]
                                [/.integer .Integer]
                                [/.revolution .Revolution]
                                [/.decimal .Decimal]
                                [/.text .Text]
                                ))

                          ($.definition /.literal
                            ""
                            ($.example (' (/.literal
                                           (is (-> ??? Code)
                                               format)
                                           (is ???
                                               (value generating expression)))))))
            random (list (,, (template.with [<name> <type>]
                               [($.definition <name>
                                  (code.as_text (' (is <type>
                                                       (<name>)))))]

                               [/.random_natural .Natural]
                               [/.random_integer .Integer]
                               [/.random_revolution .Revolution]
                               [/.random_decimal .Decimal]
                               ))

                         ($.definition /.random
                           ""
                           ($.example (' (/.random
                                          (is (-> ??? Code)
                                              format)
                                          (is (Random ???)
                                              (random data generator)))))))]
        (list.partial ($.module /._
                                "")

                      (list.together
                       (list literal
                             random))
                      ))))
