Pure-functional random value generation