[GHC] #13901: Lift the "Illegal polymorphic type" restriction on type families

GHC ghc-devs at haskell.org
Fri Jul 7 16:49:55 UTC 2017


#13901: Lift the "Illegal polymorphic type" restriction on type families
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11962            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 This isn't so easy. With type families, there are potentially many right-
 hand sides. Some may have polymorphism, and some may not. And we might not
 know which is chosen until we get to the constraint solver. When the
 constraint-generation algorithm looks at something with type `Foo`, does
 it add a wrapper for instantiating `forall a. Maybe a`? Or not? Impossible
 to know. This all smells a bit like impredicativity.

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


More information about the ghc-tickets mailing list