Update random.d.er

This commit is contained in:
Shunsuke Shibayama 2022-12-27 13:04:47 +09:00
parent 6ad4e0d964
commit 24627eb26c
4 changed files with 41 additions and 4 deletions

View file

@ -1,3 +1,14 @@
.seed!: (a := Num, version := Int) => NoneType
.randbytes!: (n: Nat) => Bytes
.randrange!: (start: Int, stop := Int, step := Int) => Int
.randint!: (a: Int, b: Int) => Int
.getrandbits!: (k: Nat) => Nat
.choice!: |T: Type, S <: Seq(T)|(seq: S) => T
# TODO: dependent length array type
.choices!: |T: Type, S <: Seq(T)|(population: S, weights := [Nat; _] or NoneType, k := Nat) => [T; _]
# TODO: Seq!
.shuffle!: |T: Type, S <: Seq(T)|(seq: S) => NoneType
.sample!: |T: Type, S <: Seq(T)|(population: S, 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