Key: Difference between revisions

Jump to navigation Jump to search
129 bytes added ,  08:37, 16 January 2022
(wp link)
Line 2: Line 2:


== Description ==
== Description ==
Monadically, key will group identical major cells together and applies the [[function]] operand f to each unique key, and the indices of the elements matching that key.
[[Monadic]]ally, Key will group identical [[major cell]]s together and applies the [[function]] operand once for each unique major cell. The function is applied with the unique major cell as left argument, while the right argument is the indices of major cells that match it:


<source lang=apl>
<source lang=apl>
Line 17: Line 17:
</source>
</source>


In the dyadic case, key applies f to the elements of the right argument corresponding to the unique elements of the left.
In the [[dyadic]] case, Key applies the function to collections of major cells from the right argument corresponding to unique elements of the left argument:


<source lang=apl>
<source lang=apl>
Line 32: Line 32:
</source>
</source>


In fact, the monadic case <source lang=apl inline>f⌸⍵</source> is equivalent to <source lang=apl inline>f⌸ ⍳≢⍵</source>
The monadic case, <source lang=apl inline>f⌸Y</source> is equivalent to <source lang=apl inline>Y f⌸ ⍳≢Y</source>.


== External links ==
== External links ==

Navigation menu