Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1016515 // foldl

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1752L/11K).

1  
static <A, B> A mapLike foldl(F2<A, B, A> f, A seed, Iterable<B> l) {
2  
  A a = seed;
3  
  if (l != null) for(B b : l)
4  
    a = callF(f, a, b);
5  
  ret a;
6  
}
7  
8  
static <A, B> A mapLike foldl(F2<A, B, A> f, A seed, B[] l) {
9  
  A a = seed;
10  
  if (l != null) for(B b : l)
11  
    a = callF(f, a, b);
12  
  ret a;
13  
}
14  
15  
static <A, B> A mapLike foldl(O f, A seed, B[] l) {
16  
  A a = seed;
17  
  if (l != null) for(B b : l)
18  
    a = (A) callF(f, a, b);
19  
  ret a;
20  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016515
Snippet name: foldl
Eternal ID of this version: #1016515/5
Text MD5: 031715cdbea6e0f1e40d4255cbc21dc1
Transpilation MD5: 2deefaca254ca9ebe67b5d00f5dee395
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-18 00:12:58
Source code size: 445 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 409 / 525
Version history: 4 change(s)
Referenced in: [show references]