How can i implement a infinite sequence generator that i can operate on using the Stream
library functions?
I want to use that to generate the first n prime numbers. I have a working recursive approach, but i like enumerables and pipes a lot better.
I have seen this done in python using a generator:
def number_generator():
n = 3
while True:
yield n
n += 2
Is there a built-in function to generate such sequences in Elixir, or a easy DIY alternative? Does this pattern have a name in Elixir?