[GHC] #13183: Template Haskell needlessly pretty-prints empty instance contexts

GHC ghc-devs at haskell.org
Wed Jan 25 01:42:39 UTC 2017


#13183: Template Haskell needlessly pretty-prints empty instance contexts
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.2.1
          Component:  Template       |           Version:  8.1
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Other
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This code:

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

 $([d| class Foo a
       instance Foo Int
     |])
 }}}

 Used to pretty-print like this on GHC 8.0.2:

 {{{
 Bug2.hs:(5,3)-(7,6): Splicing declarations
     [d| class Foo_a13B a_a13C

         instance Foo_a13B Int |]
   ======>
     class Foo_a3Jo a_a3Jp
     instance Foo_a3Jo Int
 }}}

 But on GHC HEAD, it prints a redundant instance context!

 {{{
 Bug2.hs:(5,3)-(7,6): Splicing declarations
     [d| class Foo_a1eh a_a1ei

         instance Foo_a1eh Int |]
   ======>
     class Foo_a4ly a_a4lz
     instance () => Foo_a4ly Int
 }}}

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


More information about the ghc-tickets mailing list