aboutsummaryrefslogtreecommitdiff
path: root/help/scan.md
blob: a4d84fc6f6dcda0563058a07e2735fec9123ded1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/scan.html).*

# Grave (`` ` ``)

## ``𝔽` 𝕩``: Scan
[→full documentation](../doc/scan.md)

Scan over `𝕩` with `𝔽` from left to right, producing intermediate values.


        +` 1‿2‿3

        ⟨1, 1+2, (1+2)+3⟩

        -` 1‿2‿3

        ⟨1, 1-2, (1-2)-3⟩


## ``𝕨 𝔽` 𝕩``: Scan With initial

Monadic scan, but use `𝕨` as initial left argument.

        5 +` 1‿2‿3

        ⟨5+1, (5+1)+2, ((5+1)+2)+3⟩

        5 -` 1‿2‿3

        ⟨5-1, (5-1)-2, ((5-1)-2)-3⟩