View Source Iter.Iterable.Resource (iterex v0.1.2)

An iterable which provides compatibility with Stream.resource/3

Summary

Functions

Create an iterable from functions in a manner compatible with Stream.resource/3.

Types

@type acc() :: any()
@type after_fun() :: (acc() -> any())
@type next_fun() :: (acc() -> {[Iter.Iterable.element()], acc()} | {:halt, acc()})
@type start_fun() :: (-> acc())
@type t() :: %Iter.Iterable.Resource{
  acc: acc(),
  after_fun: after_fun(),
  buffer: [Iter.Iterable.element()],
  next_fun: next_fun(),
  start_fun: nil | start_fun()
}

Functions

Link to this function

new(start_fun, next_fun, after_fun)

View Source
@spec new(start_fun(), next_fun(), after_fun()) :: t()

Create an iterable from functions in a manner compatible with Stream.resource/3.