[GHC] #15979: Core Lint error with LiberalTypeSynonyms

GHC ghc-devs at haskell.org
Tue Dec 18 21:11:39 UTC 2018


#15979: Core Lint error with LiberalTypeSynonyms
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.6.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Interestingly, there appears to be some sort of check for this already,
 but only when kind-checking. Given this:

 {{{#!hs
 data P k :: k -> Type
 }}}

 Then GHC accept the following:

 {{{#!hs
 type Foo = forall k (a :: k). P k a
 }}}

 However, it does //not// accept the following:

 {{{#!hs
 type Bar = forall k. P k
 }}}
 {{{
 $ /opt/ghc/8.6.3/bin/ghc Bug.hs
 [1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

 Bug.hs:10:22: error:
     • Expected kind ‘k0’, but ‘P k’ has kind ‘k -> *’
     • In the type ‘forall k. P k’
       In the type declaration for ‘Bar’
    |
 10 | type Bar = forall k. P k
    |                      ^^^
 }}}

 The current error message doesn't really give a clear indication as to the
 underlying cause, however.

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


More information about the ghc-tickets mailing list