Element - ÞẊ
- Cartesian Power
Description
Cartesian power, cartesian product with self n times. If both arguments are numbers, turns the left into a range.
Overloads
any-num
-cartesian_power(a, b)
num-any
-cartesian_power(b, a)
Examples
`ab` 2 ÞẊ
=⟨`aa`|`ab`|`ba`|`bb`⟩
⟨1|2⟩ 3 ÞẊ
=⟨⟨1|1|1⟩|⟨1|1|2⟩|⟨1|2|1⟩|⟨1|2|2⟩|⟨2|1|1⟩|⟨2|1|2⟩|⟨2|2|1⟩|⟨2|2|2⟩⟩
`abc` 3 ÞẊ
=⟨`aaa`|`aab`|`aac`|`aba`|`abb`|`abc`|`aca`|`acb`|`acc`|`baa`|`bab`|`bac`|`bba`|`bbb`|`bbc`|`bca`|`bcb`|`bcc`|`caa`|`cab`|`cac`|`cba`|`cbb`|`cbc`|`cca`|`ccb`|`ccc`⟩
`ab` 0 ÞẊ
=⟨⟩
`ab` 1 ÞẊ
=⟨`a`|`b`⟩
⟨⟩ 2 ÞẊ
=⟨⟩
2 2 ÞẊ
=⟨⟨1|1⟩|⟨2|1⟩|⟨1|2⟩|⟨2|2⟩⟩