xxxxxxxxxx
/+dub.sdl:
dependency "mir-random" version="~>0.4"
+/
import std.range, std.stdio;
import mir.random;
import mir.random.variable: NormalVariable;
import mir.random.algorithm: range;
void main(){
auto rng = Random(unpredictableSeed); // Engines are allocated on stack or global
auto sample = range!rng // Engines can passed to algorithms by alias or by pointer
(NormalVariable!double(0, 1)) // Random variables are passed by value
.take(10) // Fix sample length to 10 elements (Input Range API)
.array; // Allocates memory and performs computation
sample[$.randIndex].writeln; // prints random element from the sample
}