Examples

Reductions

update ... for, in one line or a block.

main (streams, print)

main()
    words = [str: "the", "cat", "the", "hat"]
    # update names an accumulator, its start, its step, and its source.
    update letters = 0 to letters + len(w) for w in stream(words)
    # A longer step is a block; for goes on its own line.
    update counts = [str -> int:] to
        seen = lookup(counts, w) ?: 0
        [*counts, w -> seen + 1]
    for w in stream(words)
    the = lookup(counts, "the") ?: 0
    print.line("{letters} {the}")
12 2