This commit is contained in:
Shunsuke Shibayama 2023-07-24 09:32:31 +09:00
parent 4dff4746b8
commit 9308a910ca
8 changed files with 140 additions and 68 deletions

View file

@ -3,12 +3,12 @@
.randrange!: (start: Int, stop := Int, step := Int) => Int
.randint!: (a: Int, b: Int) => Int
.getrandbits!: (k: Nat) => Nat
.choice!: |T: Type, S <: Sequence(T)|(seq: S) => T
.choice!: |T: Type|(seq: Sequence(T)) => T
# TODO: dependent length array type
.choices!: |T: Type, S <: Sequence(T)|(population: S, weights := [Nat; _] or NoneType, k := Nat) => [T; _]
.choices!: |T: Type|(population: Sequence(T), weights := [Nat; _] or NoneType, k := Nat) => [T; _]
# TODO: Sequence!
.shuffle!: |T: Type, S <: Sequence(T)|(seq: S) => NoneType
.sample!: |T: Type, S <: Sequence(T)|(population: S, k := Nat) => [T; _]
.shuffle!: |T: Type|(seq: Sequence(T)) => NoneType
.sample!: |T: Type|(population: Sequence(T), k := Nat) => [T; _]
.random!: () => 0.0..1.0 # TODO: <1.0
.dep_uniform! = 'uniform': |A: Int, B: Int|(a: {A}, b: {B}) => A..B
.uniform!: (a: Int, b: Int) => Int