Libraryless. Click here for Pure Java version (9955L/55K).
1 | static <A> A foldl_noSeed(F2<A, A, A> f, Iterable<A> l) {
|
2 | ret foldl_noSeed((O) f, l); |
3 | } |
4 | |
5 | static <A> A lambda0Like foldl_noSeed(IF2<A, A, A> f, Iterable<A> l) {
|
6 | Iterator<A> it = iterator(l); |
7 | if (!it.hasNext()) null; |
8 | A a = it.next(); |
9 | while (it.hasNext()) |
10 | a = f.get(a, it.next()); |
11 | ret a; |
12 | } |
13 | |
14 | static <A> A foldl_noSeed(IF2<A, A, A> f, A... l) {
|
15 | ret foldl_noSeed(f, asList(l)); |
16 | } |
17 | |
18 | static <A> A foldl_noSeed(O f, Iterable<A> l) {
|
19 | Iterator<A> it = iterator(l); |
20 | if (!it.hasNext()) null; |
21 | A a = it.next(); |
22 | while (it.hasNext()) |
23 | a = (A) callF(f, a, it.next()); |
24 | ret a; |
25 | } |
Began life as a copy of #1016515
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1017064 |
| Snippet name: | foldl_noSeed |
| Eternal ID of this version: | #1017064/7 |
| Text MD5: | edd0b45b1be6f6361a9d9f3f59e7fb97 |
| Transpilation MD5: | 4f9a3636f35e39579886296fcf089c07 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-12-20 22:16:37 |
| Source code size: | 612 bytes / 25 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 782 / 950 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |