aboutsummaryrefslogtreecommitdiff
path: root/doc/couple.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/couple.md')
-rw-r--r--doc/couple.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/couple.md b/doc/couple.md
index 3b11b2b3..3cc1ac8f 100644
--- a/doc/couple.md
+++ b/doc/couple.md
@@ -49,6 +49,6 @@ The pair function, which creates a list from its arguments, can be written `Pair
## Definitions
-As discussed above, `โ‰` is equivalent to `>{โŸจ๐•ฉโŸฉ;โŸจ๐•จ,๐•ฉโŸฉ}`. To complete the picture we should describe Merge fully. Merge is defined on an array argument `๐•ฉ` such that there's some shape `s` satisfying `โˆงยดโฅŠ(sโ‰กโ‰ข)ยจ๐•ฉ`. If `๐•ฉ` is empty then any shape satisfies this expression; `s` should be chosen based on known type information for `๐•ฉ` or otherwise assumed to be `โŸจโŸฉ`. If `s` is empty then `๐•ฉ` is allowed to contain non-arrays as well as array scalars, and these will be implicitly promoted to arrays by the `โŠ‘` indexing used later. We construct the result by combining the outer and inner axes of the argument with Table; since the outer axes come first they must correspond to the left argument and the inner axes must correspond to the right argument. `๐•ฉ` is a natural choice of left argument, and because no concrete array can be used, the right argument will be `โ†•s`, the array of indices into any element of `๐•ฉ`. To get the appropriate element corresponding to a particular choice of index and element of `๐•ฉ` we should select using that index. The result of Merge is `๐•ฉโŠ‘หœโŒœโ†•s`.
+As discussed above, `โ‰` is equivalent to `>{โŸจ๐•ฉโŸฉ;โŸจ๐•จ,๐•ฉโŸฉ}`. To complete the picture we should describe Merge fully. Merge is defined on an array argument `๐•ฉ` such that there's some shape `s` satisfying `โˆงยดโฅŠ(sโ‰กโ‰ข)ยจ๐•ฉ`. If `๐•ฉ` is empty then any shape satisfies this expression; `s` should be chosen based on known type information for `๐•ฉ` or otherwise assumed to be `โŸจโŸฉ`. If `s` is empty then `๐•ฉ` is allowed to contain atoms as well as array scalars, and these will be implicitly promoted to arrays by the `โŠ‘` indexing used later. We construct the result by combining the outer and inner axes of the argument with Table; since the outer axes come first they must correspond to the left argument and the inner axes must correspond to the right argument. `๐•ฉ` is a natural choice of left argument, and because no concrete array can be used, the right argument will be `โ†•s`, the array of indices into any element of `๐•ฉ`. To get the appropriate element corresponding to a particular choice of index and element of `๐•ฉ` we should select using that index. The result of Merge is `๐•ฉโŠ‘หœโŒœโ†•s`.
Given this definition we can also describe Rank (`โމ`) in terms of Each (`ยจ`) and the simpler monadic function Enclose-Rank `<โމk`. We assume effective ranks `j` for `๐•จ` (if present) and `k` for `๐•ฉ` have been computed. Then the correspondence is `๐•จFโމk๐•ฉ โ†โ†’ >(<โމj๐•จ)Fยจ(<โމk๐•ฉ)`.