Code that builds on 7.8.4 and 7.10.3 but fails with requiring UndecidableInstances on 8.0.1-rc4
(I am not sure if this is an issue with the release candidate or with my code. I'm sorry, I've tried hard to investigate that but not come to a firm conclusion. I'm reporting it on the chance that it might be an issue with the release candidate.)
The code at https://github.com/bjornbm/dimensional/tree/c5b41bbcecb710d566f8af6e561dcafd93ea4e20 builds and passes tests on 7.8.4 and 7.10.3. The same code fails under 8.0.1-rc4 with the following message:
src/Numeric/Units/Dimensional/Dynamic.hs:79:10: error: • The constraint ‘KnownDimension d’ is no smaller than the instance head (Use UndecidableInstances to permit this) • In the instance declaration for ‘Demotable (Quantity d)’
I'm not sure if the relationship here between
HasDynamicDimension in fact requires undecidable instances (in which case 7.8.4 and 7.10.3 are either allowing it in error? or helpfully allowing it even though they aren't obligated to?) or if it does not in fact require undecidable instances (in which case 8.0.1-rc4 is disallowing it in error).
Making things even more interesting, a new feature branch of the same project doesn't appear to change any of the things that should be relevant to this error message, but compiles and tests without the error on 8.0.1-rc4 as well as the earlier compiler versions. That one's at https://github.com/dmcclean/dimensional/tree/9f3b0a207258851964defd90ce497e75edb4fe2a.