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

25
LINES

< > BotCompany Repo | #1016965 // mapPairB - apply function to second element of each pair. also synonym of pairMapB

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

Libraryless. Click here for Pure Java version (2848L/17K).

1  
static <A, B, C> L<Pair<A, C>> lambdaMapLike mapPairB(fO f, Iterable<Pair<A, B>> l) {
2  
  ret map(l, func(Pair<A, B> p) -> Pair<A, C> {
3  
    p == null ? null : pair(p.a, (C) callF(f, p.b))
4  
  });
5  
}
6  
7  
static <A, B, C> L<Pair<A, C>> mapPairB(final F1<B, C> f, Iterable<Pair<A, B>> l) {
8  
  ret mapPairB((O) f, l);
9  
}
10  
11  
static <A, B, C> L<Pair<A, C>> mapPairB(final IF1<B, C> f, Iterable<Pair<A, B>> l) {
12  
  ret mapPairB((O) f, l);
13  
}
14  
15  
static <A, B, C> L<Pair<A, C>> mapPairB(Iterable<Pair<A, B>> l, IF1<B, C> f) {
16  
  ret mapPairB((O) f, l);
17  
}
18  
19  
static <A, B, C> Pair<A, C> lambdaMapLike mapPairB(IF1<B, C> f, Pair<A, B> p) {
20  
  ret pairMapB(f, p);
21  
}
22  
23  
static <A, B, C> Pair<A, C> lambdaMapLike mapPairB(Pair<A, B> p, IF1<B, C> f) {
24  
  ret pairMapB(f, p);
25  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1016965
Snippet name: mapPairB - apply function to second element of each pair. also synonym of pairMapB
Eternal ID of this version: #1016965/13
Text MD5: 675e5524582977ba0c55866c2544ea00
Transpilation MD5: f61848b84d45e7a438f539750dcbaab1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-25 17:39:26
Source code size: 762 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 530 / 649
Version history: 12 change(s)
Referenced in: [show references]