aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/math/random.lux9
-rw-r--r--stdlib/test/test/lux/math/random.lux4
2 files changed, 6 insertions, 7 deletions
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux
index 3225f1d6e..c922cee21 100644
--- a/stdlib/source/lux/math/random.lux
+++ b/stdlib/source/lux/math/random.lux
@@ -5,14 +5,13 @@
["M" monad #+ do Monad]
hash)
(data [bit]
- [text "Text/" Monoid<Text>]
- text/format
+ [text "text/" Monoid<Text>]
[product]
[maybe]
[number]
(number ["r" ratio]
["c" complex])
- (coll [list "List/" Fold<List>]
+ (coll [list "list/" Fold<List>]
["a" array]
["D" dict]
["Q" queue]
@@ -106,7 +105,7 @@
(do Monad<Random>
[x char-gen
xs (text' char-gen (n.dec size))]
- (wrap (Text/compose (text;from-code x) xs)))))
+ (wrap (text/compose (text;from-code x) xs)))))
(def: #export (text size)
(-> Nat (Random Text))
@@ -203,7 +202,7 @@
[array a;Array a;from-list]
[queue Q;Queue Q;from-list]
- [stack ST;Stack (List/fold ST;push ST;empty)]
+ [stack ST;Stack (list/fold ST;push ST;empty)]
)
(def: #export (set Hash<a> size value-gen)
diff --git a/stdlib/test/test/lux/math/random.lux b/stdlib/test/test/lux/math/random.lux
index ae33ab98f..003a3a803 100644
--- a/stdlib/test/test/lux/math/random.lux
+++ b/stdlib/test/test/lux/math/random.lux
@@ -3,6 +3,7 @@
(lux [io]
(control [monad #+ do Monad])
(data [number]
+ text/format
(coll [list]
[vector]
[array]
@@ -14,8 +15,7 @@
lux/test)
(context: "Random."
- #seed +1504643924987
- [size (|> r;nat (:: @ map (n.% +100)))
+ [size (|> r;nat (:: @ map (|>. (n.% +100) (n.max +10))))
_list (r;list size r;nat)
_vector (r;vector size r;nat)
_array (r;array size r;nat)