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

13
LINES

< > BotCompany Repo | #1017306 // mapPairA - apply function to first element of each pair

JavaX fragment (include)

1  
static <A, B, C> L<Pair<C, B>> mapPairA(fO f, Iterable<Pair<A, B>> l) {
2  
  ret map(l, func(Pair<A, B> p) -> Pair<C, B> {
3  
    p == null ? null : pair((C) callF(f, p.a), p.b)
4  
  });
5  
}
6  
7  
static <A, B, C> LPair<C, B> mapPairA(final F1<A, C> f, Iterable<Pair<A, B>> l) {
8  
  ret mapPairA((O) f, l);
9  
}
10  
11  
static <A, B, C> LPair<C, B> mapPairA(final IF1<A, C> f, Iterable<Pair<A, B>> l) {
12  
  ret mapPairA((O) f, l);
13  
}

Author comment

Began life as a copy of #1016965

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017306
Snippet name: mapPairA - apply function to first element of each pair
Eternal ID of this version: #1017306/2
Text MD5: c22c10622592dcc869680b90dda64799
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-10 12:48:28
Source code size: 414 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 382 / 420
Version history: 1 change(s)
Referenced in: [show references]