In Haskell, for example, you can create an endless list of random numbers on the unclean side and pass this list to your pure function. The implementation will generate the next number that your pure function uses only when it needs it, but the function is still clean.
Vesa Kaihlavirta
source
share