# `Tempo.IntervalSet.Backend.Lazy`
[🔗](https://github.com/elixir-tempo/tempo/blob/v1.6.4/lib/tempo/interval_set/backend/lazy.ex#L1)

A lazy, potentially unbounded `Tempo.IntervalSet.Backend`: the state
is an ordered generator (any `Enumerable`, typically a `Stream`)
yielding member intervals in time order, sorted by `from`, disjoint,
each anchored and bounded.

A lazy set answers the walking questions — `Tempo.IntervalSet.walk/1`,
`first/1`, `empty?/1`, `covered?/2`, `Enum.take/2`, and use as a
`Tempo.shift/3` `skipping:` busy set — without ever materialising more
members than the caller consumes. `bounded?/1` is `false`, so every
aggregate operation (`to_list/1`, `count/1`, `coalesce/1`, set
algebra) raises `Tempo.UnboundedSetError` instead of walking forever.

Build one from your own generator with
`Tempo.IntervalSet.from_stream/2`, or use a built-in source such as
`Tempo.weekends/1`. The **generator contract** is the caller's
responsibility — members in time order, non-overlapping, anchored,
bounded — because an infinite stream cannot be validated up front;
each member is checked as it is consumed.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
