aboutsummaryrefslogtreecommitdiff
path: root/help/fold.md
blob: 33b2e0f5ecdf427ab4277ee4e972af9a99fda631 (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
31
32
*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/fold.html).*

# Acute Accent (`´`)
    
## `𝔽´ 𝕩`: Fold
    
Fold over `𝕩` with `𝔽` from right to left i.e. Insert `𝔽` between the elements of `𝕩`.

`𝕩` must be a simple list (`1 = =𝕩`).

           +´ 1‿2‿3

           1+2+3

           -´ 1‿2‿3

           1-2-3

    
## `𝕨 𝔽´ 𝕩`: Fold With initial
    
Monadic fold, but use `𝕨` as initial right argument.
    
           5 +´ 1‿2‿3

           1+2+3+5

           5 -´ 1‿2‿3

           1-2-3-5