(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]
    [collection
     ["[0]" list (.use "[1]#[0]" monoid)]]]]]
 [\\library
  ["[0]" /]])

(def .public documentation
  (List $.Documentation)
  (let [simple (list ($.definition /.bit)
                     ($.definition /.i64)
                     ($.definition /.nat)
                     ($.definition /.int)
                     ($.definition /.rev)
                     ($.definition /.frac)
                     ($.definition /.char)

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

                   ($.definition /.text
                     ""
                     [(text char_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."
                    [(only pred gen)])

                  ($.definition /.one
                    ""
                    [(one check random)])

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

                  ($.definition /.and
                    "Sequencing combinator."
                    [(and left right)])

                  ($.definition /.or
                    "Heterogeneous alternative combinator."
                    [(or left right)])

                  ($.definition /.either
                    "Homogeneous alternative combinator."
                    [(either left right)])

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

                  ($.definition /.set
                    ""
                    [(set hash size value_gen)])

                  ($.definition /.dictionary
                    ""
                    [(dictionary hash size key_gen value_gen)])

                  ($.definition /.result
                    ""
                    [(result prng calc)])

                  ($.definition /.prng
                    ""
                    [(prng update return)])

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

                  ($.definition /.xoroshiro_128+
                    (format "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
                       )
                  )))
