Skip to content

Commit 3bbd42d

Browse files
committed
R instead of B
1 parent 6a8de56 commit 3bbd42d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Foldable<A> {
66

77
type Fold_<X, A, B> = { step: (x: X, a: A) => X; initial: X; extract: (x: X) => B }
88

9-
type Fold<A, B> = (run: <X>(_: Fold_<X, A, B>) => B) => B
9+
type Fold<A, B> = <R>(run: <X>(_: Fold_<X, A, B>) => R) => R
1010

1111
const fold = <A, B>(f: Fold<A, B>, fa: Foldable<A>) =>
1212
f(({ step, initial, extract }) => extract(fa.reduce(step, initial)))

0 commit comments

Comments
 (0)