Thanks to [head ~ tail] in DataWeave 2.0 we can easily create infinite sequence generators.

In this case we are implementing the Leibniz’s series to calculate an approximation of PI.