diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/math/random.lux | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux index e8a8d3263..44bded416 100644 --- a/stdlib/source/lux/math/random.lux +++ b/stdlib/source/lux/math/random.lux @@ -128,7 +128,7 @@ (template [<name> <type> <cast>] [(def: #export <name> (Random <type>) - (:: ..monad map <cast> ..i64))] + (\ ..monad map <cast> ..i64))] [nat Nat .nat] [int Int .int] @@ -137,17 +137,17 @@ (def: #export frac (Random Frac) - (:: ..monad map (|>> .i64 f.from-bits) ..nat)) + (\ ..monad map (|>> .i64 f.from-bits) ..nat)) (def: #export safe-frac (Random Frac) (let [mantissa-range (.int (i64.left-shift 53 1)) mantissa-max (i.frac (dec mantissa-range))] - (:: ..monad map - (|>> (i.% mantissa-range) - i.frac - (f./ mantissa-max)) - ..int))) + (\ ..monad map + (|>> (i.% mantissa-range) + i.frac + (f./ mantissa-max)) + ..int))) (def: #export (char set) (-> unicode.Set (Random Char)) @@ -156,13 +156,13 @@ in-range (: (-> Char Char) (|>> (n.% size) (n.+ start)))] (|> ..nat - (:: ..monad map in-range) + (\ ..monad map in-range) (..filter (unicode.member? set))))) (def: #export (text char-gen size) (-> (Random Char) Nat (Random Text)) (if (n.= 0 size) - (:: ..monad wrap "") + (\ ..monad wrap "") (do ..monad [x char-gen xs (text char-gen (dec size))] @@ -248,7 +248,7 @@ [x value-gen xs (<name> (dec size) value-gen)] (wrap (<plus> x xs))) - (:: ..monad wrap <zero>)))] + (\ ..monad wrap <zero>)))] [list List (.list) #.Cons] [row Row row.empty row.add] @@ -278,7 +278,7 @@ (if (n.= size (set.size xs+)) (wrap xs+) (recur []))))) - (:: ..monad wrap (set.new Hash<a>)))) + (\ ..monad wrap (set.new Hash<a>)))) (def: #export (dictionary Hash<a> size key-gen value-gen) (All [k v] (-> (Hash k) Nat (Random k) (Random v) (Random (Dictionary k v)))) @@ -293,19 +293,19 @@ (if (n.= size (dictionary.size kv+)) (wrap kv+) (recur []))))) - (:: ..monad wrap (dictionary.new Hash<a>)))) + (\ ..monad wrap (dictionary.new Hash<a>)))) (def: #export instant (Random Instant) - (:: ..monad map instant.from-millis ..int)) + (\ ..monad map instant.from-millis ..int)) (def: #export date (Random Date) - (:: ..monad map instant.date ..instant)) + (\ ..monad map instant.date ..instant)) (def: #export duration (Random Duration) - (:: ..monad map duration.from-millis ..int)) + (\ ..monad map duration.from-millis ..int)) (def: #export month (Random Month) |