aboutsummaryrefslogtreecommitdiff
path: root/help/´fold.md
blob: 0f3d2a6943ae414e0e375c0994c2fc34759d9e48 (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
Acute Accent (`´`)

`𝔽´ 𝕩`: Fold

Fold over `𝕩` with `𝔽` from right to left i.e. Insert `𝔽` between the elements of `𝕩`.
```
   +´ 1‿2‿3
6
   1+2+3
6
   -´ 1‿2‿3
2
   1-2-3
2
```
`𝕨 𝔽´ 𝕩`: Fold With initial

Monadic fold, but use `𝕨` as initial right argument.
```
   5 +´ 1‿2‿3
11
   1+2+3+5
11
   5 -´ 1‿2‿3
¯3
   1-2-3-5
¯3
```