Comprehensions, as values and as loops.
A comprehension used as a value is an iterator pipeline: each generator filters and binds
its items in one filter_map, later generators nest through flat_map, and the result is
collected into the type expected, or the collection into: names. Run for its effects, a
comprehension is nested for loops, and for ..., reduce: acc is a loop updating acc.
Summary
Functions
A collect() given the type it collects into, when Rust cannot infer it.
The type a binding collects into: its own, or a list of what Rust infers for a slice.
A comprehension split into its qualifiers and its options, into:, reduce:, and do:.
Lowers a comprehension used as a value, collecting into expected_type when known.
Lowers a comprehension run for its effects, as nested for loops.
Lowers for ..., reduce: acc as a loop updating acc.
Functions
A collect() given the type it collects into, when Rust cannot infer it.
The type a binding collects into: its own, or a list of what Rust infers for a slice.
A comprehension split into its qualifiers and its options, into:, reduce:, and do:.
Lowers a comprehension used as a value, collecting into expected_type when known.
Lowers a comprehension run for its effects, as nested for loops.
Lowers for ..., reduce: acc as a loop updating acc.