Choose

The 2-modifier Choose (`โถ`) applies one function from a list `๐`, based on the selecting index returned by a function `๐ฝ`. It's a combinator form of Pick (`โ`), so that `{fโ(๐จ๐ฝ๐ฉ)โ๐ โ ๐จF๐ฉ}` is a complete definition. For example, the function below subtracts 1 from its argument if negative and adds 1 if positive.

โ๏ธ
```    0โธโคโถโจ-โ1, +โ1โฉยจ 3โฟยฏ1โฟ5
โจ 4 ยฏ2 6 โฉ
```

Here the selection function `๐ฝ` is `0โธโค`, while `๐` is a list of two functions `โจ-โ1, +โ1โฉ`. On the first argument, `3`, `๐ฝ3` is `0โค3`, or `1`, so the function `+โ1` from `๐` is chosen. The use of array indices means "false" comes first in `๐` and "true" comes second, which is backwards relative to if-else constructs in most programming languages (including BQN's own predicates). When using a comparison for `๐ฝ` I strongly prefer to phrase it as `nโธ<` or `nโธโค` so that smaller values go through the first one and larger functions go through the second. This doesn't apply so much when comparing two arguments since one is smaller but the other's larger, so I don't have an easy answer for that.

โ๏ธ
```    2 >โถโฃโฟโข 6  # A minimum function (โ)
2
```

The advantage of using an index is that Choose works with any number of options.

โ๏ธ
```    Fn โ (โ"rtd"โโ)โถโจโฝ, 1โธโ, 1โธโ, โขโฉ  # Reverse, take 1, drop 1

Fn "r123"
"321r"

Fn "d123"
"123"

Fn "123"  # Default
"123"
```

The selection function in `Fn` uses Index of (`โ`) to find the index of the first character in the list `"rtd"`. An extra value in `๐` serves as a default function if it's none of those, since the result of `๐ฝ` is `3` in that case. A similar function that's often useful is Bins, for grouping inputs into intervals rather than by exact matching.

Choose is necessary for tacit programming, but tacit programming is not necessary to be an effective BQN programmer! Consider using block features like predicates when Choose isn't working with your program's flow.

Because Choose is based on Pick, it retains the features of negative, multidimensional, and multiple selection. Negative indexing might make sense if there's some special `ยฏ1` value, and if the options naturally form an array, multidimensional indexing is pretty neat. Selecting multiple values from `๐`, which happens if the result of `๐ฝ` is an array of arrays, is never useful because the array result from `๐ฝ` acts as a constant function. It's much clearer to express it as `๐ฝโ๐ห`.