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

7
LINES

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

JavaX fragment (include)

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

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: 179 / 206
Referenced in: [show references]