... 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]]
    [collection
     ["[0]" list (.use "[1]#[0]" monoid)]]]]]
 [\\library
  ["[0]" /]])

(the .public documentation
  (List $.Documentation)
  (let [simple (list ($.definition /.bit)
                     ($.definition /.i64)
                     ($.definition /.natural)
                     ($.definition /.integer)
                     ($.definition /.revolution)
                     ($.definition /.decimal)
                     ($.definition /.character)

                     ($.definition /.safe_decimal
                       "A number in the interval [0.0,1.0]."))
        text (list ($.definition /.unicode)
                   ($.definition /.ascii)
                   ($.definition /.alphabetic)
                   ($.definition /.alpha_numeric)
                   ($.definition /.numeric)
                   ($.definition /.upper_cased)
                   ($.definition /.lower_cased)

                   ($.definition /.text
                     ""
                     ($.example (' (text character_gen size)))))]
    (list.partial ($.module /._
                            "Pseudo-random number generation (PRNG) algorithms.")

                  ($.definition /.functor)
                  ($.definition /.apply)
                  ($.definition /.monad)
                  
                  ($.definition /.ratio)
                  ($.definition /.complex)

                  ($.definition /.maybe)
                  ($.definition /.list)
                  ($.definition /.sequence)
                  ($.definition /.array)
                  ($.definition /.queue)
                  ($.definition /.stack)

                  ($.definition /.instant)
                  ($.definition /.date)
                  ($.definition /.time)
                  ($.definition /.duration)
                  ($.definition /.month)
                  ($.definition /.day)

                  ($.definition /.PRNG
                    "An abstract way to represent any PRNG.")

                  ($.definition (/.Random it)
                    "A producer of random values based on a PRNG.")

                  ($.definition /.only
                    "Retries the generator until the output satisfies a predicate."
                    ($.example (' (only pred gen))))

                  ($.definition /.one
                    ""
                    ($.example (' (one check random))))

                  ($.definition /.refined
                    "Retries the generator until the output can be refined."
                    ($.example (' (refined refiner gen))))

                  ($.definition /.and
                    "Sequencing combinator."
                    ($.example (' (and left right))))

                  ($.definition /.or
                    "Heterogeneous alternative combinator."
                    ($.example (' (or left right))))

                  ($.definition /.either
                    "Homogeneous alternative combinator."
                    ($.example (' (either left right))))

                  ($.definition /.rec
                    "A combinator for producing recursive random generators."
                    ($.example (' (rec gen))))

                  ($.definition /.set
                    ""
                    ($.example (' (set hash size value_gen))))

                  ($.definition /.dictionary
                    ""
                    ($.example (' (dictionary hash size key_gen value_gen))))

                  ($.definition /.value
                    ""
                    ($.example (' (value prng calc))))

                  ($.definition /.prng
                    ""
                    ($.example (' (prng update return))))

                  ($.definition /.pcg_32
                    (%.message "An implementation of the PCG32 algorithm."
                               \n "For more information, please see: http://www.pcg-random.org/"))

                  ($.definition /.xoroshiro_128+
                    (%.message "An implementation of the Xoroshiro128+ algorithm."
                               \n "For more information, please see: http://xoroshiro.di.unimi.it/"))

                  ($.definition /.split_mix_64
                    "An implementation of the SplitMix64 algorithm.")

                  (all list#composite
                       simple
                       text
                       )
                  )))
