Today we’re going to start a series of episodes on a topic that might not seem very functional: randomness.
Swift 4.2 introduces much-needed library support for randomness, which was designed from the ground up to be easier and safer to use than the existing available APIs. We’re going to take a look at some of the problems it was designed to solve and explore how we may have solved them in an alternate, functional API rooted in composition.
We’ll start by taking quick look at the original problems.