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

11
LINES

< > BotCompany Repo | #1032238 // repFToSet - call a function repeatedly, collect into set

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

Libraryless. Click here for Pure Java version (41L/1K).

static <A> Set<A> lambdaMapLike repFToSet(IF0<A> f, int n) {
  new Set<A> set;
  repeat n {
    set.add(f!);
  }
  ret set;
}

static <A> Set<A> repFToSet(int n, IF0<A> f) {
  ret repFToSet(f, n);
}

Author comment

Began life as a copy of #1007438

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032238
Snippet name: repFToSet - call a function repeatedly, collect into set
Eternal ID of this version: #1032238/3
Text MD5: 6026e513e7f8105ba5bc7c6ceb833979
Transpilation MD5: 78b469619351583c49fd5886cc8a8a28
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-21 03:51:00
Source code size: 208 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 79 / 133
Version history: 2 change(s)
Referenced in: [show references]