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).

1  
static <A> WithProbability<A> withProbability(double probability, A a) {
2  
  ret WithProbability(probability, a);
3  
}
4  
5  
static <A> L<WithProbability<A>> withProbability(IF1<A, Double> makeProbability, Iterable<A> l) {
6  
  ret map(a -> withProbability(makeProbability.get(a), a), l);
7  
}

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: 193 / 276
Version history: 3 change(s)
Referenced in: [show references]