[GHC] #12040: Code that builds on 7.8.4 and 7.10.3 but fails with requiring UndecidableInstances on 8.0.1-rc4
GHC
ghc-devs at haskell.org
Tue May 10 16:27:54 UTC 2016
#12040: Code that builds on 7.8.4 and 7.10.3 but fails with requiring
UndecidableInstances on 8.0.1-rc4
-------------------------------------+-------------------------------------
Reporter: dmcclean | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Keywords: | Operating System: Linux
Architecture: | Type of failure: GHC rejects
Unknown/Multiple | valid program
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
(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 `Demotable`,
`KnownDimension`, `HasDimension`, and `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.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12040>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list