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

7
LINES

< > BotCompany Repo | #1031512 // withProbability - make WithProbability

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

Libraryless. Click here for Pure Java version (3548L/19K).

static <A> WithProbability<A> withProbability(double probability, A a) {
  ret WithProbability(probability, a);
}

static <A> L<WithProbability<A>> withProbability(IF1<A, Double> makeProbability, Iterable<A> l) {
  ret map(a -> withProbability(makeProbability.get(a), a), l);
}

Author comment

Began life as a copy of #1028471

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031512
Snippet name: withProbability - make WithProbability
Eternal ID of this version: #1031512/4
Text MD5: d60cd22be50f9c6ea26a9538fe0282f9
Transpilation MD5: edfbe45a2cc84e087d7a6f54b5460b29
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-20 05:12:15
Source code size: 283 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 194 / 277
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1031967 - withProbability1 - make WithProbability
#1032031 - withPreciseProbability - make WithPreciseProbability