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

21
LINES

< > BotCompany Repo | #1006887 // findPred - synonym of firstThat - find first element in list that matches a predicate

JavaX fragment (include)

1  
static <A> A findPred(Iterable<A> l, IF1<A, Bool> pred) {
2  
  ret firstThat(l, pred);
3  
}
4  
5  
6  
7  
static <A> A findPred(A[] l, IF1<A, Bool> pred) {
8  
  ret firstThat(l, pred);
9  
}
10  
11  
12  
13  
static <A> A lambdaMapLike findPred(IF1<A, Bool> pred, Iterable<A> l) {
14  
  ret firstThat(pred, l);
15  
}
16  
17  
18  
19  
static <A> A lambdaMapLike findPred(IF1<A, Bool> pred, A[] l) {
20  
  ret firstThat(pred, l);
21  
}

Author comment

Began life as a copy of #1006407

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006887
Snippet name: findPred - synonym of firstThat - find first element in list that matches a predicate
Eternal ID of this version: #1006887/3
Text MD5: 8d7ae03bf19dbc2afd2ea4ad268ff16e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-10 23:51:38
Source code size: 370 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 413 / 442
Version history: 2 change(s)
Referenced in: [show references]