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

9
LINES

< > BotCompany Repo | #1018106 // mapPairBoth - apply function to both elements of each pair

JavaX fragment (include)

1  
static <A, C> LPair<C> mapLike mapPairBoth(fO f, Iterable<Pair<A>> l) {
2  
  ret map(l, func(Pair<A> p) -> Pair<C> {
3  
    p == null ? null : pair((C) callF(f, p.a), (C) callF(f, p.b))
4  
  });
5  
}
6  
7  
static <A, C> LPair<C> mapPairB(final F1<A, C> f, Iterable<Pair<A>> l) {
8  
  ret mapPairBoth((O) f, l);
9  
}

Author comment

Began life as a copy of #1016965

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018106
Snippet name: mapPairBoth - apply function to both elements of each pair
Eternal ID of this version: #1018106/5
Text MD5: a88400963f4195c6953f56d047c6c726
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-06 16:28:03
Source code size: 300 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 395 / 424
Version history: 4 change(s)
Referenced in: [show references]