A random example
The C library has two functions for random numbers
n = rand();
srand(k);
These functions rely on the random seed as a side effect
Functional style:
val (n, new_s) = rand(s)
Previous slide
Next slide
Back to first slide
View graphic version