We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a8de56 commit 3bbd42dCopy full SHA for 3bbd42d
src/index.ts
@@ -6,7 +6,7 @@ interface Foldable<A> {
6
7
type Fold_<X, A, B> = { step: (x: X, a: A) => X; initial: X; extract: (x: X) => B }
8
9
-type Fold<A, B> = (run: <X>(_: Fold_<X, A, B>) => B) => B
+type Fold<A, B> = <R>(run: <X>(_: Fold_<X, A, B>) => R) => R
10
11
const fold = <A, B>(f: Fold<A, B>, fa: Foldable<A>) =>
12
f(({ step, initial, extract }) => extract(fa.reduce(step, initial)))
0 commit comments