Where do the key paths that will be fed into the mapper function come from? This idea blends into a thread I posted on automatic conformance for tuples. If your algorithm comes across a product nominal type with tuple members, instead of just posting a compile-time error that the type can’t conform, pierce the tuple by not including the tuple’s key path, but the key paths for all of its constituents instead. (If a constituent is a nested tuple, it’s recursively pierced and replaced too. So an tuple member causes the outer nominal type to fail only if the tuple has at least one inner non-tuple member that can’t qualify.)
Have you thought about the Codable
family? I covered that in another branch of my thread.