[GHC] #10270: inconsistent semantics of type class instance visibility outside recursive modules
GHC
ghc-devs at haskell.org
Wed Apr 8 21:38:36 UTC 2015
#10270: inconsistent semantics of type class instance visibility outside recursive
modules
-------------------------------------+-------------------------------------
Reporter: skilpat | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: GHC rejects | (amd64)
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: #9562 | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by ezyang):
The plan was for orphan instances, to check if any given instance was in
the set of orphan modules which are transitively imported from this
module. We did implement it.
Unfortunately, this doesn't directly help here because the instance in
A.hs is NOT an orphan, so we just assume that it's in scope. So in some
sense, this is the same problem that we were grappling with hsigs:
sometimes, a non-orphan instance should NOT be visible, because it was not
defined in the hs-boot/hsig file. We ''also'' spent a bit of time thinking
about how to solve this, but all of our solutions boiled down to some
variant of "put the set of transitively imported modules (including non-
orphan modules)" into the interface, with various schemes for optimizing
this since this results in quadratic growth of interface files.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10270#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list