blob: 56b812f8655555b85de852423018870a803ecc0a (
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/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
|