Stream.unfold/2
3 min readMay 17, 2022
The Stream module in Elixir is full of amazingness! One of those hidden gems is the Stream.unfold/2 function.
Today I would like to take the time and show you a couple of example usages of the unfold function to help make you understand how powerful it can be.
But first, let’s start by reading the documentation for Stream.unfold/2:
Emits a sequence of values for the given accumulator.