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

14
LINES

< > BotCompany Repo | #1021427 - any - check if predicate matches on any element of collection

JavaX fragment (include)

static <A> bool mapLike any(O pred, Iterable<A> l) {
  if (l != null) for (A a : l)
    if (isTrue(callF(pred, a)))
      true;
  false;
}

static <A> bool any(IF1<A, Bool> pred, Iterable<A> l) {
  ret any((O) pred, l);
}

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

download  show line numbers  debug dex   

Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1021427
Snippet name: any - check if predicate matches on any element of collection
Eternal ID of this version: #1021427/8
Text MD5: 043e780a1e5305a948fb3d94ca9b9aed
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-17 23:05:21
Source code size: 313 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 68 / 86
Version history: 7 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1021427 & http://1021427.tinybrain.de