diff options
Diffstat (limited to 'stdlib/source/lux/math/random.lux')
-rw-r--r-- | stdlib/source/lux/math/random.lux | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux index c26bd7c38..f38a0c571 100644 --- a/stdlib/source/lux/math/random.lux +++ b/stdlib/source/lux/math/random.lux @@ -192,13 +192,13 @@ (def: #export (or left right) {#.doc "Heterogeneous alternative combinator."} (All [a b] (-> (Random a) (Random b) (Random (| a b)))) - (do {@ ..monad} + (do {! ..monad} [? bit] (if ? - (do @ + (do ! [=left left] (wrap (0 #0 =left))) - (do @ + (do ! [=right right] (wrap (0 #1 =right)))))) @@ -220,10 +220,10 @@ (def: #export (maybe value-gen) (All [a] (-> (Random a) (Random (Maybe a)))) - (do {@ ..monad} + (do {! ..monad} [some? bit] (if some? - (do @ + (do ! [value value-gen] (wrap (#.Some value))) (wrap #.None)))) @@ -257,10 +257,10 @@ (def: #export (set Hash<a> size value-gen) (All [a] (-> (Hash a) Nat (Random a) (Random (Set a)))) (if (n.> 0 size) - (do {@ ..monad} + (do {! ..monad} [xs (set Hash<a> (dec size) value-gen)] (loop [_ []] - (do @ + (do ! [x value-gen #let [xs+ (set.add x xs)]] (if (n.= size (set.size xs+)) @@ -271,10 +271,10 @@ (def: #export (dictionary Hash<a> size key-gen value-gen) (All [k v] (-> (Hash k) Nat (Random k) (Random v) (Random (Dictionary k v)))) (if (n.> 0 size) - (do {@ ..monad} + (do {! ..monad} [kv (dictionary Hash<a> (dec size) key-gen value-gen)] (loop [_ []] - (do @ + (do ! [k key-gen v value-gen #let [kv+ (dictionary.put k v kv)]] |