Why are continuable enumerators not exposed in the Stream module?

Elixir’s continuable enumerators are wonderful. While slightly more complex than vanilla Stream functions, there are a decent number of times I have found :suspended or :halted quite useful.

From my understanding they are used quite extensivly in the Stream module for functions such as zip and take. But desipe their prevolece and usefulness they are only exposed via Enumerable.reduce.

From my perspective as an admitendly a novice user of Elixir, I am quite suprised Stream.take and Stream.take_while don’t have the option to return continuable enumerators. Something along the lines of Stream.take(enum, count, :suspend) and Stream.take_while(enum, count, :halt) seem like a perfect fit for the Stream module.

Cosidering continuable enumerators have been around since 0.12.0, is their any reason that continuable enumerator tuples have not been exposed in the Stream module?

2 Likes