[GHC] #13895: "Illegal constraint in a type" error - is it fixable?

GHC ghc-devs at haskell.org
Fri Jul 7 17:54:50 UTC 2017


#13895: "Illegal constraint in a type" error - is it fixable?
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 You want impredicativity. But you can't have it. :)

 The problem is more visible when we expand your `Typeable t` constraint to
 write explicitly the kind argument: `Typeable (forall k. k -> Type) t`,
 which uses a polytype to instantiate a datatype parameter.

 I'm afraid I don't have a workaround to suggest...

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13895#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list