struct TupleDict{TD, K, V} <: AbstractDict{K, V}

A Dict-like structure which maps keys of various types to values of various types in a type stable manner. Crucially, for every key of type TK, it must map to a value of type TV.

With a traditional Dict, keys of distinct types mapping to values of distinct types cannot lead to type stable retrieval. However, a TupleDict is type stable, even when the valtype for each keytype is different.

TupleDict(d1, d2...)

Constructs a TupleDict from an iterable td of Dicts, or a sequence of Dicts d1, d2, d3....

Dicts which share a valtype are merged such that their keys are stored in the same Dict. Dicts of distinct valtypes are left as separate Dicts in order to make getkey type inferrable.

Note that all input Dicts must satisfy the following constraints:

1. All `Dict`s must have concrete `keytype`, or a `keytype` which is a `Union{...}` of concrete types
2. You cannot pass in `Dict`s whose `keytype`s overlap

The first requirement helps us avoid amiguities where Dicts over abstract types may make identifying the correct key ambiguous (e.g. two Dicts, one with Number and one with Float64 keys).

The second requirement ensures/requires that all keys of a given type map to only one valtype.