aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/math/random.lux
blob: 8dcfb98dde9588b88309c36ce83c1d10e79c0a19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
(.module:
  [library
   [lux (#- or and nat int rev)
    ["$" documentation (#+ documentation:)]
    [data
     ["." text (#+ \n)
      ["%" format (#+ format)]]]
    [macro
     ["." template]]]]
  [\\library
   ["." /]])

(documentation: /.PRNG
  "An abstract way to represent any PRNG.")

(documentation: /.Random
  "A producer of random values based on a PRNG.")

(documentation: /.only
  "Retries the generator until the output satisfies a predicate."
  [(only pred gen)])

(documentation: /.one
  ""
  [(one check random)])

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

(documentation: /.safe_frac
  "A number in the interval [0.0,1.0].")

(documentation: /.text
  ""
  [(text char_gen size)])

(documentation: /.and
  "Sequencing combinator."
  [(and left right)])

(documentation: /.or
  "Heterogeneous alternative combinator."
  [(or left right)])

(documentation: /.either
  "Homogeneous alternative combinator."
  [(either left right)])

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

(documentation: /.set
  ""
  [(set hash size value_gen)])

(documentation: /.dictionary
  ""
  [(dictionary hash size key_gen value_gen)])

(documentation: /.result
  ""
  [(result prng calc)])

(documentation: /.prng
  ""
  [(prng update return)])

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

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

(documentation: /.split_mix_64
  "An implementation of the SplitMix64 algorithm.")

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            "Pseudo-random number generation (PRNG) algorithms."
            [..PRNG
             ..Random
             ..only
             ..one
             ..refined
             ..safe_frac
             ..text
             ..and
             ..or
             ..either
             ..rec
             ..set
             ..dictionary
             ..result
             ..prng
             ..pcg_32
             ..xoroshiro_128+
             ..split_mix_64
             ($.default /.functor)
             ($.default /.apply)
             ($.default /.monad)
             
             ($.default /.bit)
             ($.default /.i64)
             ($.default /.nat)
             ($.default /.int)
             ($.default /.rev)
             ($.default /.frac)
             ($.default /.char)

             ($.default /.unicode)
             ($.default /.ascii)
             ($.default /.ascii/alpha)
             ($.default /.ascii/alpha_num)
             ($.default /.ascii/numeric)
             ($.default /.ascii/upper)
             ($.default /.ascii/lower)
             
             ($.default /.ratio)
             ($.default /.complex)

             ($.default /.maybe)
             ($.default /.list)
             ($.default /.row)
             ($.default /.array)
             ($.default /.queue)
             ($.default /.stack)

             ($.default /.instant)
             ($.default /.date)
             ($.default /.time)
             ($.default /.duration)
             ($.default /.month)
             ($.default /.day)]
            []))