diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/math/random.lux | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/math/random.lux b/stdlib/source/library/lux/math/random.lux index 7c1fbc448..85cce4485 100644 --- a/stdlib/source/library/lux/math/random.lux +++ b/stdlib/source/library/lux/math/random.lux @@ -129,7 +129,7 @@ (with_template [<name> <type> <cast>] [(def .public <name> (Random <type>) - (at ..functor each (|>> <cast>) ..i64))] + (of ..functor each (|>> <cast>) ..i64))] [nat Nat .nat] [int Int .int] @@ -138,13 +138,13 @@ (def .public frac (Random Frac) - (at ..functor each (|>> .i64 f.of_bits) ..nat)) + (of ..functor each (|>> .i64 f.of_bits) ..nat)) (def .public safe_frac (Random Frac) (let [mantissa_range (.int (i64.left_shifted 53 1)) mantissa_max (i.frac (-- mantissa_range))] - (at ..functor each + (of ..functor each (|>> (i.% mantissa_range) i.frac (f./ mantissa_max)) @@ -158,13 +158,13 @@ in_range (is (-> Char Char) (|>> (n.% size) (n.+ start)))] (|> ..nat - (at ..functor each in_range) + (of ..functor each in_range) (..only (unicode.member? set))))) (def .public (text char_gen size) (-> (Random Char) Nat (Random Text)) (if (n.= 0 size) - (at ..monad in "") + (of ..monad in "") (do ..monad [x char_gen xs (text char_gen (-- size))] @@ -244,7 +244,7 @@ [x value_gen xs (list (-- size) value_gen)] (in {.#Item x xs})) - (at ..monad in (.list)))) + (of ..monad in (.list)))) (def .public (sequence size value_gen) (All (_ a) (-> Nat (Random a) (Random (Sequence a)))) @@ -253,7 +253,7 @@ [x value_gen xs (sequence (-- size) value_gen)] (in (sequence.suffix x xs))) - (at ..monad in sequence.empty))) + (of ..monad in sequence.empty))) (with_template [<name> <type> <ctor>] [(def .public (<name> size value_gen) @@ -279,7 +279,7 @@ (if (n.= size (set.size xs+)) (in xs+) (again []))))) - (at ..monad in (set.empty hash)))) + (of ..monad in (set.empty hash)))) (def .public (dictionary hash size key_gen value_gen) (All (_ k v) (-> (Hash k) Nat (Random k) (Random v) (Random (Dictionary k v)))) @@ -294,23 +294,23 @@ (if (n.= size (dictionary.size kv+)) (in kv+) (again []))))) - (at ..monad in (dictionary.empty hash)))) + (of ..monad in (dictionary.empty hash)))) (def .public instant (Random Instant) - (at ..functor each instant.of_millis ..int)) + (of ..functor each instant.of_millis ..int)) (def .public date (Random Date) - (at ..functor each instant.date ..instant)) + (of ..functor each instant.date ..instant)) (def .public time (Random Time) - (at ..functor each instant.time ..instant)) + (of ..functor each instant.time ..instant)) (def .public duration (Random Duration) - (at ..functor each duration.of_millis ..int)) + (of ..functor each duration.of_millis ..int)) (def .public month (Random Month) |