Re:Python 3 Types in the Wild
by whimsicalism on Sunday March 20, 2022 @05:24PM
(#30746801)
I see, so you can never really get a match_failure due to type level mismatch with GADT because it would be caught by the compiler.
Makes sense to me.
In the GADTs case, the type system is only used to remove the failure branch. For instance,
is translated to because the typechecker can prove that the `B` case is impossible. In other words, GADTs are yet another instance where the type system can be used to eliminate dead code in the untyped IR.