Libraryless. Click here for Pure Java version (2034L/13K).
1 | static <A, B extends Iterable<A>> ItIt<L<A>> outerProduct_faster(L<B> lists) {
|
2 | ret mapI fromSimplyLinkedList(outerProduct_faster(toSimplyLinkedList(lists))); |
3 | } |
4 | |
5 | static <A, B extends Iterable<A>> ItIt<SimplyLinkedList<A>> outerProduct_faster(SimplyLinkedList<B> lists) {
|
6 | if (lists == null) ret singletonIterator(null); |
7 | SimplyLinkedList<B> lists2 = lists.tail; |
8 | ret nestedIterator(lists.head, func(A a) -> Iterator<SimplyLinkedList<A>> {
|
9 | mapI(outerProduct_faster(lists2), l -> SimplyLinkedList.cons(a, l)) |
10 | }); |
11 | } |
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: | #1023792 |
| Snippet name: | outerProduct_faster [OK] |
| Eternal ID of this version: | #1023792/5 |
| Text MD5: | 1707c53482b94801eb0ae63fb32c008d |
| Transpilation MD5: | 0e71e3873a9fdf4a7c0ae0e22f83a61b |
| 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:28:43 |
| Source code size: | 532 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 429 / 600 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |