Monadic function ∪
#
Unique works on major cells:
matrix←6 2⍴2 7 1 8 2 8 1 8 2 8 4 5
matrix
2 7
1 8
2 8
1 8
2 8
4 5
∪matrix
2 7
1 8
2 8
4 5
Dyadic function ⍸
and monadic functions ⍋
and ⍒
#
Interval index, Grade up, and Grade down use Total Array Ordering to work on the major cells:
'Adam' 'Jay' 'Roger'⍸2 3⍴'APLXYZ' ⍝ scalars of a vector
0 2 2
3 3 3
(3 5⍴'Adam Jay Roger')⍸2 5⍴'KarenGitte' ⍝ vectors of a matrix
2 1
vector←0 0J2 ¯1 'A' 1 0J¯2
⍋vector
3 6 1 2 5 4
{(⊂⍋⍵)⌷⍵}vector ⍝ new special-cased idiom
¯1 0J¯2 0 0J2 1 A
{(⊂⍒⍵)⌷⍵}vector ⍝ new special-cased idiom
A 1 0J2 0 0J¯2 ¯1