Change History (4)

FYI Simon pointed out that my example from 2893 wasn't actually making use of the GADT-carried dictionary. Instead, it was just using the top level instance decl.

The story is that GHC can infer polymorphic evidence but not make use of it, even with this sort of GADT trick. If you explicitly scrutinise the polymorphic GADT at a monomorphic type GHC *can* make use of the evidence, however.

Even if GHC is unable to use the polymorphic evidence, I feel like its presence should not cause an error when the code would otherwise have worked. If that’s true, this is a regression from 7.0. But probably nobody writes code like this, so I guess the question is whether there’s now a good reason to disallow it.