Libraryless. Click here for Pure Java version (3963L/23K).
static <A, B, C> Map<B, C> lambdaMapLike mapToMap_pcall(IF1<A, Pair<B, C>> f, Iterable<A> l) { new Map<B, C> map; fOr (A o : l) pcall { Pair<B, C> p = callF(f, o); map.put(p.a, p.b); } ret map; } static <A, B, C> Map<B, C> mapToMap_pcall(Iterable<A> l, IF1<A, Pair<B, C>> f) { ret mapToMap_pcall(f, l); } /*static <A, B, C, D> Map<C, D> mapToMap(Map<A, B> m, IF2<A, B, Pair<C, D>> f) { ret mapMapToMap(f, m); } static <A, B, C, D> Map<C, D> mapToMap(IF2<A, B, Pair<C, D>> f, Map<A, B> m) { ret mapMapToMap(f, m); }*/
Began life as a copy of #1024294
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032620 |
Snippet name: | mapToMap_pcall - mapToMap + pcall |
Eternal ID of this version: | #1032620/1 |
Text MD5: | b239572c77f9ce8cb763cb48d5a2d18a |
Transpilation MD5: | 484c27e290a7d65d745736e7aaf43e87 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-29 18:14:42 |
Source code size: | 560 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 162 / 220 |
Referenced in: | [show references] |