showing Ratios

Ian Lynagh igloo at earth.li
Thu Feb 25 10:07:46 EST 2010


On Thu, Feb 25, 2010 at 09:54:04AM -0500, Doug McIlroy wrote:
> Very minor library change to promote readability of output:
> eliminate spaces in the string representation of Ratios.
> 
> Currently, a Ratio appears as a pair separated by " % ".
> The spaces that flank "%" make for confusing output.
> Example:
> 
> 	[1 % 2,1 % 3,1 % 4,1 % 5,1 % 6]
> 
> The spaces suggest that "," binds more tightly than "%".
> I claim that
> 
> 	[1%2,1%3,1%4,1%5,1%6]

See also:

http://www.mail-archive.com/glasgow-haskell-bugs@haskell.org/msg14853.html
http://hackage.haskell.org/trac/ghc/ticket/1920

A comment in the code says:
-- H98 report has spaces round the %
-- but we removed them [May 04]
-- and added them again for consistency with
-- Haskell 98 [Sep 08, #1920]


Thanks
Ian



More information about the Haskell-prime mailing list