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).

static <A, B, C> L<Pair<A, C>> lambdaMapLike mapPairB(fO f, Iterable<Pair<A, B>> l) {
  ret map(l, func(Pair<A, B> p) -> Pair<A, C> {
    p == null ? null : pair(p.a, (C) callF(f, p.b))
  });
}

static <A, B, C> L<Pair<A, C>> mapPairB(final F1<B, C> f, Iterable<Pair<A, B>> l) {
  ret mapPairB((O) f, l);
}

static <A, B, C> L<Pair<A, C>> mapPairB(final IF1<B, C> f, Iterable<Pair<A, B>> l) {
  ret mapPairB((O) f, l);
}

static <A, B, C> L<Pair<A, C>> mapPairB(Iterable<Pair<A, B>> l, IF1<B, C> f) {
  ret mapPairB((O) f, l);
}

static <A, B, C> Pair<A, C> lambdaMapLike mapPairB(IF1<B, C> f, Pair<A, B> p) {
  ret pairMapB(f, p);
}

static <A, B, C> Pair<A, C> lambdaMapLike mapPairB(Pair<A, B> p, IF1<B, C> f) {
  ret pairMapB(f, p);
}

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: 445 / 541
Version history: 12 change(s)
Referenced in: [show references]