⊆ — Nest / Partition
Function. Keys: Alt-Minus z. Hanzi: 巢/段. Ranks: ∞ monadic, 1 ∞ dyadic
⊆Y encloses atoms and simple arrays. Already-nested arrays stay unchanged.
⊆1 2 ⍝ ⊂1 2
⊆1 ⍝ ⊂1N⊆Y partitions along the leading axis. Each partition is a block of major cells. A zero in N leaves out its major cell. A new partition starts wherever N rises.
1 1 0 1 1⊆"abcde" ⍝ "ab" "de"
1 1 0 2⊆4 2⍴⍳8ₓ ⍝ [[0 1⋄2 3] [6 7⋄]]ₓMarks are nonnegative whole numbers. Unit and singleton marks extend. N⊆⍠K Y partitions along axis K instead. N⊆⍤1 Y partitions each row. Unlike ⊂, positive marks need not start a partition at every position.
1 1 0 1 1⊆⍤1 ["abcde"⋄"fghij"] ⍝ ["ab" "de"⋄"fg" "ij"]Inverse
⊆⁻Y discloses a unit and gives back any other array. X⊆⁻Y joins the parts Y. Partitioning the result by X must give Y again, so X can’t hold a zero.
⊆⁻⊂1 2 ⍝ 1 2
1 1 2⊆⁻(1 2⋄3) ⍝ 1 2 3