[GHC] #9918: GHC chooses an instance between two overlapping, but cannot resolve a clause within the similar closed type family
GHC
ghc-devs at haskell.org
Tue Jan 13 09:47:28 UTC 2015
#9918: GHC chooses an instance between two overlapping, but cannot resolve a
clause within the similar closed type family
-------------------------------------+-------------------------------------
Reporter: qnikst | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by simonpj):
GHC has always permitted types that are uninhabited (except by bottom);
consider
{{{
data Void -- No constructors
}}}
So I don't see why `(undefined :: TT a)` should be a problem. I certainly
don't see a problem with `test4` or `test5`. Your instance of `C [a]`
does not require `C a`, and so of course we can compute the length of a
list `[TT a]` without knowing anything about the type `TT a`. That's just
parametricity.
Simon
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9918#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list