1. Array is an object, so you can iterate it as you would iterate mapped types, which doesn't have stack overflow issues
2. The elements are a tuple, so you can quickly access the members by their indexes.
3. You can extract the numerical value by infering the numeric string.
Comments
The key extraction is a bit hacky though!
1. Array is an object, so you can iterate it as you would iterate mapped types, which doesn't have stack overflow issues
2. The elements are a tuple, so you can quickly access the members by their indexes.
3. You can extract the numerical value by infering the numeric string.
To enforce an invariant, we need to apply `out` to enforce contravariance and `in` to enfore covariance to the generic type.
To get the return type, we can `infer` it.
Since I don't want to deal with some funny cases, I just implemented hacky helper functions to deal with it (don't do this 😂)