UNPKG
dashp
Version:
latest (0.11.0)
0.11.0
0.10.1
0.10.0
0.9.0
0.8.1
Utilities for monadic promises.
github.com/critocrito/dashp
critocrito/dashp
dashp
/
src
/
fold.js
7 lines
(5 loc)
•
182 B
JavaScript
View Raw
1
2
3
4
5
6
7
import
{
of
}
from
"./Future"
;
import
{curry3}
from
"./internal/curry"
;
export
default
curry3
(
"fold"
,
(
f, acc, xs
) =>
xs.
reduce
(
(
memo, x
) =>
memo.
then
(
(
y
) =>
f
(y, x)),
of
(acc)), );