diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-05 22:20:19 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-05 22:20:19 -0400 |
| commit | c96289046dbd42678c10d03ceb5734737392bf4c (patch) | |
| tree | fc897441ab6de8f5453aceb0424ff3969c696d4f /doc/couple.md | |
| parent | 3734638f2f04b5e298dca250f589ae1e4913f88f (diff) | |
Inter-documentation links and minor editing
Diffstat (limited to 'doc/couple.md')
| -rw-r--r-- | doc/couple.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/couple.md b/doc/couple.md index f78d441c..e88acb75 100644 --- a/doc/couple.md +++ b/doc/couple.md @@ -30,7 +30,7 @@ In all cases what these functions do is more like reinterpreting existing data t ⥊ ⥊¨ a ∾ ⥊ ⥊¨ a -The way this happens, and the constraint that all inner arrays have the same shape, is closely connected to the concept of an array, and like Table `⌜`, Merge might be considered a fundamental way to build up multidimensional arrays from lists. In both cases rank-0 or unit arrays are somewhat special. They are the identity element of a function with Table, and can be produced by Merge inverse, `>⁼` **on a list**, which forces either the outer or inner shape to be empty (BQN chooses `>⁼` to be `<`, but only on an array, as `>` cannot produce non-arrays). Merge has another catch as well: it cannot produce arrays with a `0` in the shape, except at the end, without some sort of prototype system. +The way this happens, and the constraint that all inner arrays have the same shape, is closely connected to the concept of an array, and like [Table](map.md#table) `⌜`, Merge might be considered a fundamental way to build up multidimensional arrays from lists. In both cases rank-0 or [unit](enclose.md#whats-a-unit) arrays are somewhat special. They are the [identity value](fold.md#identity-values) of a function with Table, and can be produced by Merge inverse, `>⁼` **on a list**, which forces either the outer or inner shape to be empty (BQN chooses `>⁼` to be `<`, but only on an array, as `>` cannot produce non-arrays). Merge has another catch as well: it cannot produce arrays with a `0` in the shape, except at the end, unless fills can be specified. ⊢ e ← ⟨⟩¨ ↕3 ≢ > e @@ -40,7 +40,7 @@ Above we start with a list of three empty arrays. After merging once we get a sh ## Coupling units -A note on the topic of Solo and Couple applied to units. As always, one axis will be added, so that the result is a list (strangely, J's [laminate](https://code.jsoftware.com/wiki/Vocabulary/commaco#dyadic) differs from Couple in this one case, as it will add an axis to get a shape `2‿1` result). For Solo, this is interchangeable with Deshape (`⥊`), and either primitive might be chosen for stylistic reasons. For Couple, it is equivalent to Join-to (`∾`), but this is an irregular form of Join-to because it is the only case where Join-to adds an axis to both arguments instead of just one. Couple should be preferred in this case. +A note on the topic of Solo and Couple applied to units. As always, one axis will be added, so that the result is a list (strangely, J's [laminate](https://code.jsoftware.com/wiki/Vocabulary/commaco#dyadic) differs from Couple in this one case, as it will add an axis to get a shape `2‿1` result). For Solo, this is interchangeable with [Deshape](reshape.md) (`⥊`), and either primitive might be chosen for stylistic reasons. For Couple, it is equivalent to [Join-to](join.md) (`∾`), but this is an irregular form of Join-to because it is the only case where Join-to adds an axis to both arguments instead of just one. Couple should be preferred in this case. The pair function, which creates a list from its arguments, can be written `Pair ← ≍○<`, while `≍` in either valence is `>∘Pair`. As an interesting consequence, `≍ ←→ >∘≍○<`, and the same relationship holds for `Pair`. |
