A tiny tuple-like implementation in JavaScript.
npm install tuples
const { tuple, fst, snd, swap } = require('tuples')
const t = tuple(1, 2) // => [1, 2]
fst(t) // => 1
snd(t) // => 2
swap(t) // => [2, 1]
Construct a new tuple.
Extract the first component of a pair.
Extract the second component of a pair.
Swap the components of a pair.