

# `⌸` — Key

Monadic operator. Keys: `Alt-q =`

`K f⌸Y` groups major cells of `Y` by corresponding keys in `K`. Calls
`key f group`; groups appear in first-occurrence order.

``` bpl
1 1 2{+/⍵}⌸10 20 30 ⍝ 30 30
```

`f⌸Y` uses `Y` as keys and their positions as values. `≢⊢ ⌸Y` counts the
items with each key, without building the groups.

``` bpl
≢⊢ ⌸"banana"      ⍝ [1 3 2]ₓ
```

Keys match with [tolerance](../evaluation.qmd#equality-and-ordering), as
in `≠`. Results assemble with fill. Empty input calls `f` once for its
prototype.
