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

11
LINES

< > BotCompany Repo | #1008382 // pairMap - apply function to both elements of a pair

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

Transpiled version (1571L) is out of date.

static Pair pairMap(O f, Pair p) {
  ret p == null ? null : pair(callF(f, p.a), callF(f, p.b));
}

static <A> Pair<A> lambdaMapLike pairMap(IF1<A> f, Pair<A> p) {
  ret p == null ? null : pair(callF(f, p.a), callF(f, p.b));
}

static Pair pairMap(Pair p, O f) {
  ret pairMap(f, p);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008382
Snippet name: pairMap - apply function to both elements of a pair
Eternal ID of this version: #1008382/4
Text MD5: f9189e7ff39dd6746c34f2ec8ab6bcf3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-14 17:06:47
Source code size: 296 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 561 / 691
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1008530 - mapPair - synonym of pairMap - apply function to both elements of a pair
#1017529 - pairListMap - apply function to both elements of a pair in list of pairs
#1024264 - tripleMap - apply function to all elements of a triple
#1024766 - pairMapB - apply function to second element of a pair
#1028831 - mapBasicLogicRule - apply function to both sides of a rule