UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

14 lines (13 loc) 358 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.xprod = void 0; function xprod(a, b) { if (arguments.length === 1) return (b_) => xprod(a, b_); const result = []; (a || []).forEach((aa) => { (b || []).forEach((bb) => result.push([aa, bb])); }); return result; } exports.xprod = xprod;