Stream.unfold/2

Dunya Kirkali
3 min readMay 17, 2022
Photo by Thomas Renaud on Unsplash

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.

--

--

Dunya Kirkali

I'm an engineering manager passionate about empowering engineers to deliver exceptional work through collaboration and innovation.