#1920: Show instance for Ratio is wrong
----------------------------+-----------------------------------------------
 Reporter:  guest           |          Owner:  simonmar  
     Type:  bug             |         Status:  new       
 Priority:  normal          |      Milestone:  6.8 branch
Component:  libraries/base  |        Version:  6.6.1     
 Severity:  normal          |     Resolution:            
 Keywords:                  |     Difficulty:  Unknown   
 Testcase:                  |   Architecture:  Unknown   
       Os:  Unknown         |  
----------------------------+-----------------------------------------------
Comment (by simonmar):

 Replying to [comment:10 ross]:
 > So are you also proposing that the Show instance for infix constructors
 should be similarly changed?

 Actually I thought derived `Show` for infix constructors already omitted
 the spaces, but I guess not.  In that case, yes I do think it should omit
 spaces.

 But that might be a bigger divergence from Haskell 98, and so for
 consistency perhaps we should keep the spaces in the `Ratio` instance and
 defer it all until Haskell'.

 > Probably not, because the second argument might have a unary minus.

 GHC does correctly put in the parentheses:

 {{{
 data T = Int ::: Int deriving (Show)

 main = print ((-1) ::: (-2))
 }}}
 {{{
 > runhaskell 1920.hs
 (-1) ::: (-2)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1920#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to