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

7
LINES

< > BotCompany Repo | #1023795 // outerProduct [old]

JavaX fragment (include)

static <A, B extends Iterable<A>> ItIt<L<A>> outerProduct(L<B> lists) {
  if (empty(lists)) ret singletonIterator(new L);
  L<B> lists2 = dropFirst(lists);
  ret nestedIterator(first(lists), func(A a) -> Iterator<L<A>> {
    mapI(outerProduct(lists2), l -> itemPlusList(a, l))
  });
}

Author comment

Began life as a copy of #1023780

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023795
Snippet name: outerProduct [old]
Eternal ID of this version: #1023795/1
Text MD5: e8b68f11cdca55c2e252a75b8c34134e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-09 03:29:01
Source code size: 290 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 97 / 127
Referenced in: [show references]