product-iterable
Requirements
- Node >= 6.0.0
Features
-
Make a Cartesian product of iterables
-
Create a Cartesian power of an iterable
Usage
Import
var ProductIterable = ;
Constructor
Cartesian product of iterables
Form
var product = ...iterables;
Where:
-
...iterables
are finite iterable objects -
product
is an iterable of tuples
Example
var product = 'abc' 0 1 2 3;console;
You would seen a set of (character, number)
pairs
::pow
a.k.a ::times
Function: Cartesian power of an iterable
Form
var power = ProductIterable;
Where:
-
iterable
is a finite iterable object, let's suppose its length equal to L -
exponent
is an unsigned integer, let's call it E -
power
is an iterable object which iterates LE number of arrays ofiterable
's elements
Example
var power = ProductIterable;console;
Just like new ProductIterable('abcd', 'abcd', 'abcd')
, you would seen a set of 43 arrays