Skip to content

Commit

Permalink
issue-#57 - src/list - Progress on pseudo curry, to curry, method con…
Browse files Browse the repository at this point in the history
…versions - Converted methods upto 'or' method.
  • Loading branch information
elycruz committed Aug 3, 2022
1 parent c04d742 commit 02620df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/fjl/src/list/mapAccumL.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {curry} from "../function/curry";
import {sliceCopy} from "./utils/sliceCopy";
import {length} from "./length";
import {Slice} from "../types/data";
Expand Down Expand Up @@ -29,4 +28,7 @@ export const
return [agg, mapped];
},

$mapAccumL = curry(mapAccumL);
$mapAccumL = <A = any, B = any, MapRetT = any>(op: MapAccumOp<A, B, MapRetT>) =>
(zero: A) =>
(xs: Slice<B>): [A, Slice<MapRetT>] =>
mapAccumL(op, zero, xs);
6 changes: 4 additions & 2 deletions packages/fjl/src/list/mapAccumR.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {curry} from "../function/curry";
import {sliceCopy} from "./utils/sliceCopy";
import {length} from "./length";
import {Indexable, MapAccumOp, Slice} from "../types";
Expand Down Expand Up @@ -27,4 +26,7 @@ export const
return [agg, mapped];
},

$mapAccumR = curry(mapAccumR);
$mapAccumR = <A = any, B = any, C = any>(op: MapAccumOp<A, B, C>) =>
(zero: A) =>
(xs: Slice<B>): [A, Slice<C>] =>
mapAccumR(op, zero, xs);

0 comments on commit 02620df

Please sign in to comment.