Data.Typed
No module comment.
A type, as a value: the constructor's qualified name and its arguments.
The name is TCon.name, which is module-qualified and which type_key,
match and unification already compare. So equality of two reps is equality
of two types, and cast needs no notion of identity the compiler does not
already use for everything else.
The arguments are a Prim.Array rather than a Data.Array.Array because
that is what the compiler builds most cheaply: a synthesized instance writes
one directly as Core.
A type named without a value of it. typeRep has to mention a somewhere
in its signature or no call could say which instance it wanted; Proxy is
the argument that does that and carries nothing.
A type as a value, so that a packed payload can be asked what it is.
Instances are derived by the solver and a program may not write one: a hand-written instance could claim any type for any value, which is exactly what makes an unchecked cast unsound.
What a type is called: the module-qualified constructor name, so two reps are equal exactly when the types they describe are.
The rep of one type argument. Out of range panics, as indexing does.
An argument that takes arguments of its own is parenthesized, because
Pair Box Int String and Pair (Box Int) String are different types and a
rendering that cannot tell them apart is worse than no rendering.
Structural, because that is what type identity is: the same constructor applied to the same arguments. A cast compares these and converts nothing unless they agree.