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)

static <A> A findPred(Iterable<A> l, IF1<A, Bool> pred) {
  ret firstThat(l, pred);
}



static <A> A findPred(A[] l, IF1<A, Bool> pred) {
  ret firstThat(l, pred);
}



static <A> A lambdaMapLike findPred(IF1<A, Bool> pred, Iterable<A> l) {
  ret firstThat(pred, l);
}



static <A> A lambdaMapLike findPred(IF1<A, Bool> pred, A[] l) {
  ret firstThat(pred, l);
}

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: 411 / 440
Version history: 2 change(s)
Referenced in: [show references]