There is no Unknown variant on purpose: not knowing is None at the API boundary, so
there is exactly one spelling of it. A variant would give callers two, and the
interesting bug is a rule that treats one of them as an answer.
Build a union from its members, or the single type if that is what it comes to.
Members are flattened one level, deduplicated and sorted. Sorting is not the
determinism requirement — source order is deterministic too — it is that
string | number and number | string are the same type and must produce one
answer. Ord on Type puts primitives before nominals and orders each group by
name, which is a total order over everything this crate can build.
Returns None for an empty union, which is not a type and must not be reported as
one.