Tuple
Tuple module: utilities for 2-tuples (pairs).
All functions operate on (a, b) pairs. Use let-destructuring to access components.
Functions
Applies f to the pair t as a single tuple argument: f(t).
`(a, b) -> c` is a function of ONE argument that is a pair — not a
two-argument function, which March spells curried, `a -> b -> c`. To apply
a two-argument function to a pair, destructure it: `let (x, y) = t`.Returns true if both elements satisfy their respective predicates.
Returns the first element of a pair.
Creates a pair from two values.
Applies f to the first element and g to the second element.
Applies f to the first element, returning a new pair.
Applies f to the second element, returning a new pair.
Returns the second element of a pair.
Swaps the two elements of a pair.
Converts a pair to a 2-element list. Both elements must be the same type.
Unzips a list of pairs into a pair of lists.
Zips two lists into a list of pairs. Stops at the shorter list.