[GHC] #15869: Discrepancy between seemingly equivalent type synonym and type family

GHC ghc-devs at haskell.org
Fri Jan 18 18:21:54 UTC 2019


#15869: Discrepancy between seemingly equivalent type synonym and type family
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.6.2
  checker)                           |             Keywords:  TypeFamilies,
      Resolution:                    |  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 (2) might also be its own issue, since you can trigger the "expecting more
 arguments" error without VDQ:

 {{{#!hs
 {-# LANGUAGE DataKinds #-}
 {-# LANGUAGE TypeFamilies #-}
 module Bug where

 type family F

 type family G (f :: F) where
   G f = f Int
 }}}
 {{{
 $ /opt/ghc/8.6.3/bin/ghc Bug.hs
 [1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

 Bug.hs:8:5: error:
     • Expecting one more argument to ‘f’
       Expected kind ‘F’, but ‘f’ has kind ‘* -> k0’
     • In the first argument of ‘G’, namely ‘f’
       In the type family declaration for ‘G’
   |
 8 |   G f = f Int
   |     ^
 }}}

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


More information about the ghc-tickets mailing list