Module Pair
A module that provides a pair of values of type A and B.
In qtil parlance, a “Pair” is a specific set of two types, A and B, constrained by some
predicate, a “Tuple” has three or more types/values, and a “Product” is the combination of
types/values which are not constrained by a predicate.
To use this module, write a predicate that holds for the two types you want to constrain, and instantiate this module like so:
import qtil.tuple.Pair
predicate myPredicate(int a, string b) {
a = [0..10] and b = a.toString()
}
class MyIntStringPair = Pair<int, string, myPredicate>::Pair;
Each tuple type exposes the getFirst() and getSecond() member predicates, which retrieves
the first and second values of the pair, respectively.
Import path
import qtil.tuple.PairClasses
Parameters
| A | InfiniteStringableType | |
| B | InfiniteStringableType | |
| constraint | pred |