{ suits: ["Spade", "Heart", "Diamond", "Club"], ranks: [2, 3, 4, 5, 6, 7, 8, 9, 10, "Jack", "Queen", "King", "Ace"], and: (l, r) => if(l, r, l), or: (l, r) => if(l, l, r), flatten: (lists) => reduce((l, r) => l + r, lists, []), // I think we need `super` _color: (suit) => if(or(suit == "Heart", suit == "Diamond"), "Red", "Black"), card: (_suit, _rank) => {suit: _suit, rank: _rank, color: _color(suit)}, cards: flatten(map((suit) => map((rank) => card(suit, rank), ranks), suits)), } // { // suits: ["Spade", "Heart", "Diamond", "Club"], // ranks: [2, 3, 4, 5, 6, 7, 8, 9, 10, "Jack", "Queen", "King", "Ace"], // and: (l, r) => if(l, r, l), // or: (l, r) => if(l, l, r), // flatten: (lists) => reduce((l, r) => l + r, lists, []), // cross: (l1, l2) => flatten(map((l1v) => map((l2v) => [l1v, l2v], l2), l1)), // // color: (suit) => if(suit == "Heart" `or` suit == "Diamond", "Red", "Black"), // card: (suit, rank) => {suit: super.suit, rank: super.rank, color: super.color(suit)}, // cards: starmap(card, suits * ranks), // }