diff --git a/doc/join.md b/doc/join.md index b687a946..8aceb4d7 100644 --- a/doc/join.md +++ b/doc/join.md @@ -65,4 +65,4 @@ Axes with length 1 in the argument can also be left out, if it's done consistent Even with the extension, Join has fairly strict requirements on the shapes of its argument elements—although less strict than those of Merge, which requires they all have identical shape. Suppose the argument to Join has rank `m`. The highest element rank (call it `n`) must be at least `m`. The trailing shapes `(-n-m)↑⟜≢¨𝕩` must all be identical (the trailing shape `(-n-m)↑≢∾𝕩` of the result will match these shapes as well). The other entries in the leading shapes need not be the same, but the shape of an element along a particular axis must depend only on the location of the element along that axis in the full array. For a list argument this imposes no restriction, since the one leading shape element is allowed to depend on position along the only axis. But for higher ranks the structure quickly becomes more rigid. -To state this requirement more formally in BQN, we say that there is some list `s` of lists of lengths, so that `(≢¨s)≡≢𝕩`. We require element `i⊑𝕩` to have shape `i⊑¨s`. Then the first `m` axes of the result are `+´¨s`. To handle omitted axes, we change `s` to contain lists of length 0 or 1 instead of lengths, and require `i⊑𝕩` to have shape `∾i⊑¨s` instead. In the result, an omitted axis behaves exactly like a length-1 axis, so the result can be found using shapes derived from `1⊣´¨¨s`. +To state this requirement more formally in BQN, we say that there is some list `s` of lists of lengths, so that `(≠¨s)≡≢𝕩`. We require element `i⊑𝕩` to have shape `i⊑¨s`. Then the first `m` axes of the result are `+´¨s`. To handle omitted axes, we change `s`'s elements to contain lists of length 0 or 1 instead of lengths, and require `i⊑𝕩` to have shape `∾i⊑¨s` instead. In the result, an omitted axis behaves exactly like a length-1 axis, so the result can be found using shapes derived from `1⊣´¨¨s`. diff --git a/docs/doc/join.html b/docs/doc/join.html index bfca60e4..c2363616 100644 --- a/docs/doc/join.html +++ b/docs/doc/join.html @@ -117,4 +117,4 @@

Join

Even with the extension, Join has fairly strict requirements on the shapes of its argument elements—although less strict than those of Merge, which requires they all have identical shape. Suppose the argument to Join has rank m. The highest element rank (call it n) must be at least m. The trailing shapes (-n-m)¨𝕩 must all be identical (the trailing shape (-n-m)↑≢∾𝕩 of the result will match these shapes as well). The other entries in the leading shapes need not be the same, but the shape of an element along a particular axis must depend only on the location of the element along that axis in the full array. For a list argument this imposes no restriction, since the one leading shape element is allowed to depend on position along the only axis. But for higher ranks the structure quickly becomes more rigid.

-

To state this requirement more formally in BQN, we say that there is some list s of lists of lengths, so that (¨s)≡≢𝕩. We require element i𝕩 to have shape i¨s. Then the first m axes of the result are +´¨s. To handle omitted axes, we change s to contain lists of length 0 or 1 instead of lengths, and require i𝕩 to have shape i¨s instead. In the result, an omitted axis behaves exactly like a length-1 axis, so the result can be found using shapes derived from 1´¨¨s.

+

To state this requirement more formally in BQN, we say that there is some list s of lists of lengths, so that (¨s)≡≢𝕩. We require element i𝕩 to have shape i¨s. Then the first m axes of the result are +´¨s. To handle omitted axes, we change s's elements to contain lists of length 0 or 1 instead of lengths, and require i𝕩 to have shape i¨s instead. In the result, an omitted axis behaves exactly like a length-1 axis, so the result can be found using shapes derived from 1´¨¨s.