From 2afb23928e1984d475cc460e1672e8f6fa0e4dbe Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 11 Aug 2021 17:21:31 -0400 Subject: Allow clicking on header to get fragment link --- docs/doc/map.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/map.html') diff --git a/docs/doc/map.html b/docs/doc/map.html index 91c27caf..b7c4afe5 100644 --- a/docs/doc/map.html +++ b/docs/doc/map.html @@ -4,10 +4,10 @@ BQN: Mapping modifiers -

Mapping modifiers

+

Mapping modifiers

Mapping a function over an array means to call it on each element of that array, creating an array of results. It's also possible to map over two arrays, applying the function to various choices of one element from each, but there's no longer a single correct way to iterate over these elements.

BQN has two 1-modifiers to map over arrays: Each (¨) and Table (). On two arguments, Table applies its operand to all combinations of elements while Each creates a one-to-one or one-to-many matching. Since they apply to elements, these modifiers are different from Cells (˘) or its generalization Rank (), which apply the function to array cells. The modifier Depth () is a generalization of Each, so that ¨ is ¯1; however, it can't be used to implement Table without some additional array operations.

-

One-argument mapping

+

One-argument mapping

@@ -66,7 +66,7 @@ "indexorder"

When an array is displayed, index order is the same as the top-to-bottom, left-to-right reading order of English. It's also the same as the ordering of Deshape's result, so that here o ends up being 𝕩. The dyadic cases described in the following sections will also have a defined evaluation order, but it's not as easy to describe it in terms of the arguments: instead, the result elements are produced in index order.

-

Table

+

Table

@@ -158,7 +158,7 @@ ⟨ 2 2 3 ⟩

Except for the more sophisticated shape, this result is exactly what you'd get if you deshaped each argument to a list. In each case, every element of 𝕨 is visited in turn, and each time the element is paired with every element of 𝕩.

-

Each

+

Each

-- cgit v1.2.3