summaryrefslogtreecommitdiff
path: root/lib/std/rand.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-01 21:09:50 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-11 22:16:11 -0800
commit90e26e0f687da28530b3b967df0cedf20407c071 (patch)
tree09c85ff396a5f235dbcbd5db2df911b5217bb472 /lib/std/rand.myr
parent94448201527e0c47c2924219bf1a8d0c0c2406b7 (diff)
downloadmc-90e26e0f687da28530b3b967df0cedf20407c071.tar.gz
Move to new trait syntax.
Diffstat (limited to 'lib/std/rand.myr')
-rw-r--r--lib/std/rand.myr12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/rand.myr b/lib/std/rand.myr
index c2a03fd..9cea564 100644
--- a/lib/std/rand.myr
+++ b/lib/std/rand.myr
@@ -13,12 +13,12 @@ pkg std =
const mksrng : (seed : uint32 -> rng#)
const freerng : (rng : rng# -> void)
- generic rand : (lo : @a::(numeric,integral), hi : @a::(numeric,integral) -> @a::(numeric,integral))
- generic randnum : (-> @a::(numeric,integral))
+ generic rand : (lo : @a, hi : @a -> @a) :: numeric,integral @a
+ generic randnum : (-> @a) :: numeric,integral @a
const randbytes : (buf : byte[:] -> void)
- generic rngrand : (rng : rng#, lo : @a::(numeric,integral), hi : @a::(numeric,integral) -> @a::(numeric,integral))
- generic rngrandnum : (rng : rng# -> @a::(numeric,integral))
+ generic rngrand : (rng : rng#, lo : @a, hi : @a -> @a) ::numeric,integral @a
+ generic rngrandnum : (rng : rng# -> @a) :: numeric,integral @a
const rngrandbytes : (rng : rng#, buf : byte[:] -> void)
;;
@@ -90,7 +90,7 @@ designed by David Blackman and Sebastiano Vigna.
See http://xoroshiro.di.unimi.it/ for details.
*/
-generic rngrandnum = {rng -> @a::(numeric,integral)
+generic rngrandnum = {rng -> @a :: numeric,integral @a
var s0, s1, r
s0 = rng.s0
@@ -101,5 +101,5 @@ generic rngrandnum = {rng -> @a::(numeric,integral)
rng.s0 = (s0 << 55 | s0 >> 9) ^ s1 ^ (s1 << 14)
rng.s1 = (s1 << 36 | s1 >> 28)
- -> (r : @a::(numeric,integral))
+ -> (r : @a)
}