3 ms·
> I'm not sure that this still allows subtyping of that GADT as if it were a regular class. It does, more or less, since any subtype will have to implement the
by contravariant 6y ago
> I'm not sure that this still allows subtyping of that GADT as if it were a regular class.
It does, more or less, since any subtype will have to implement the "accept" method for the visitor, which has been defined to only 'accept' the values that can be represented by the GADT. Any subtype will need to define how its possible values map to that of the supertype.