Cartesian product of two or more lists: Difference between revisions
Cartesian product of two or more lists (view source)
Revision as of 11:59, 18 September 2019
, 4 years ago→Functional JS
(→Functional JS: Updated applicative version) |
m (→Functional JS) |
||
Line 1,092:
For the Cartesian product of just two lists:
<lang JavaScript>(() => {
// CARTESIAN PRODUCT OF TWO LISTS
// cartProd :: [a] -> [b] -> [[a, b]]
Line 1,099:
// TEST
return [
cartProd([1, 2])([3, 4]),
|