[GHC] #9223: Type equality makes type variable untouchable
GHC
ghc-devs at haskell.org
Sat Dec 6 00:24:14 UTC 2014
#9223: Type equality makes type variable untouchable
-------------------------------------+-------------------------------------
Reporter: Feuerbach | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
(Type checker) | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by tvynr):
Ah ha! This makes perfect sense; thank you for the excellent example and
explanation. In particular, this points out that whether a principled
type exists is dependent upon some pretty incidental factors, like whether
the output type and the input type happen to have anything in common. I
can see why GHC conservatively rejects both of these, since getting it to
work would result in a somewhat fragile system.
I had previously supposed that the problem was somehow related to the fact
that I had two data -- the `TokenType` and the payload -- and that the `a`
in the first parameter of `SomeToken` (`t a`) was not being unified with
the `a` in the second parameter (`a`) for the purposes of inference. I
think I had gotten than impression by the names `a` and `a1` without
realizing that one of them arose merely due to the use of `+` in the body.
Thanks again!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9223#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list