From bfe6470ff5cb5d5f9524f3874f48214dd2293d9c Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 25 May 2004 09:11:57 +0000 Subject: [PATCH] [project @ 2004-05-25 09:11:57 by simonpj] Remove spaces around the "%" when showing ratios. This is not absolutely strictly according to the H98 report, but it was suggested by Doug McIlroy According to the standard prelude, a list of Ratios prints like this: [1 % 1,1 % 2,1 % 3,1 % 4], which strongly suggests the grouping [1 % (1,1) % (2,1) % (3,1) % 4]. Even standing alone outside of lists, the style is at odds with mathematical custom. When did you last see 1/2 written as 1 / 2? --- GHC/Real.lhs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GHC/Real.lhs b/GHC/Real.lhs index edee350..b71d679 100644 --- a/GHC/Real.lhs +++ b/GHC/Real.lhs @@ -262,7 +262,8 @@ instance (Integral a) => Show (Ratio a) where {-# SPECIALIZE instance Show Rational #-} showsPrec p (x:%y) = showParen (p > ratioPrec) $ showsPrec ratioPrec1 x . - showString " % " . + showString "%" . -- H98 report has spaces round the % + -- but we removed them [May 04] showsPrec ratioPrec1 y instance (Integral a) => Enum (Ratio a) where -- 1.7.10.4