View Source Guesswork.Answer.PartiallyEvaluated (Guesswork v0.5.0)
Represents a partially evaluated enumerable of answers, allowing the answer sets to be handled one at a time.
Summary
Functions
Checks if the stream has been fully consumed
If possible, takes the first item in the stream and evaluates it. Otherwise marks the value as done.
Takes a list of partial evaluations and attempts to calculate the next set of unioned answer sets, based on the next evaluated answer set unioned with the previously evaluated answer sets.
Types
@type t() :: %Guesswork.Answer.PartiallyEvaluated{ done?: boolean(), evaluated: [Guesswork.Answer.t()], evaluated_count: integer(), stream: Enumerable.t(Guesswork.Answer.t()) }
Functions
Checks if the stream has been fully consumed
If possible, takes the first item in the stream and evaluates it. Otherwise marks the value as done.
@spec new(Enumerable.t(Guesswork.Answer.t())) :: t()
@spec next_unions([t()]) :: :empty | :done | {:ok, [t()], [Guesswork.Answer.t()]}
Takes a list of partial evaluations and attempts to calculate the next set of unioned answer sets, based on the next evaluated answer set unioned with the previously evaluated answer sets.