[GHC] #15365: Argument-less infix declarations printed without parentheses in -ddump-splices

GHC ghc-devs at haskell.org
Wed Jul 11 20:05:44 UTC 2018


#15365: Argument-less infix declarations printed without parentheses in -ddump-
splices
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Template       |           Version:  8.4.3
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Debugging
  Unknown/Multiple                   |  information is incorrect
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Compile this:

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

 $([d| type (|||) = Either

       (&&&) :: Bool -> Bool -> Bool
       (&&&) = (&&)

       data (***)
     |])
 }}}

 And you'll get this:

 {{{
 $ /opt/ghc/8.4.3/bin/ghci Bug.hs
 GHCi, version 8.4.3: 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)-(12,6): Splicing declarations
     [d| (&&&_a1xt) :: Bool -> Bool -> Bool
         (&&&_a1xt) = (&&)

         type |||_a1xs = Either
         data ***_a1xr |]
   ======>
     type |||_a5bW = Either
     (&&&_a5bV) :: Bool -> Bool -> Bool
     (&&&_a5bV) = (&&)
     data ***_a5bX
 Ok, one module loaded.
 }}}

 Notice the pretty-printed declarations of `type |||_a5bW` and `data
 ***_a5bX`, which are lacking some necessary parentheses.

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


More information about the ghc-tickets mailing list