Iteration
"for" loops
The usual way to iterate a collection is with a for loop.
A for loop is an expression. It can be void, or return an output collection.
A type annotation after the for keyword types the entire for expression.
A for loop can be squeezed onto one line using then.
for loops are just a convenient syntax for calling a function named for-loop with a lambda.
There are also for* loops, which work like for loops,
but the body returns a collection that is flattened into the result.
These call a function named for-star.
Iteration with early return
There is no early return from a for loop; it always iterates every element of the collection.
The most primitive iteration function is some which stops when the lambda returns true.
A more general function is first.
Here, the callback returns an option, and the first non-empty result is returned.
first works a lot like an until loop with a condition-body (see Loops);
it keeps running the body until it gets a result.
Unlike an until loop, it can also stop running if it reaches the end of the collection,
so it returns an option.