I realised you don't actually need toSeq here 😔
import random, sugar, math
proc foo[T, U](a: openArray[T], cdf: openArray[U]): auto =
let (a, cdf) = (@a, @cdf)
(() => random.sample(a, cdf.cumsummed))
echo foo([1,2], [1,2])()
Run
- Capture Problem schmidh
- Re: Capture Problem dawkot
- Re: Capture Problem schmidh
- Re: Capture Problem dawkot
