[GHC] #14817: GHC 8.4.1 pretty-prints data family instances with redundant kind signatures using -ddump-splices

GHC ghc-devs at haskell.org
Sat Feb 17 07:42:37 UTC 2018


#14817: GHC 8.4.1 pretty-prints data family instances with redundant kind
signatures using -ddump-splices
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.4.1-alpha3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Consider this program:

 {{{#!hs
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# OPTIONS_GHC -ddump-splices #-}
 module Bug where

 $([d| data family Foo :: *
       data instance Foo :: * |])
 }}}

 On GHC 8.2.2, this gives the following `-ddump-splices` output:

 {{{
 $ /opt/ghc/8.2.2/bin/ghci Bug.hs
 GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
 Bug.hs:(6,3)-(7,31): Splicing declarations
     [d| data family Foo_a1sB :: *

         data instance :: * |]
   ======>
     data family Foo_a494 :: GHC.Types.Type
     data instance :: GHC.Types.Type
 }}}

 But on GHC 8.4.1, we have:

 {{{
 $ /opt/ghc/8.4.1/bin/ghci Bug.hs
 GHCi, version 8.4.0.20180209: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
 Bug.hs:(6,3)-(7,31): Splicing declarations
     [d| data family Foo_a1xd :: *

         data instance Foo_a1xd :: * :: * |]
   ======>
     data family Foo_a487 :: GHC.Types.Type
     data instance Foo_a487 :: GHC.Types.Type :: GHC.Types.Type
 }}}

 Notice how there is a redundant kind signature in `data instance Foo_a1xd
 :: * :: *`.

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


More information about the ghc-tickets mailing list