5 # Reductions fold collections into a single value:
6 assert (+: [1, 2, 3])! == ???
7 assert (*: [2, 3, 4])! == ???
9 # If an empty argument is given, a `none` value is returned
11 assert (+: empty) == none
13 # Use `or` to provide a fallback:
14 assert (+: empty) or 100 == ???
16 # `_min_` and `_max_` work as reducers:
17 assert (_max_: [10, 30, 20])! == ???
18 assert (_min_.length: ["x", "abcd", "yz"])! == "???"
20 # Comprehensions inside reductions:
21 assert (+: i * 2 for i in [1, 2, 3])! == ???
23 assert (+: i for i in 10 if i.is_prime())! == ???