Show instance of Ratio

Neil Mitchell ndmitchell at
Wed Nov 28 08:37:19 EST 2007


The GHC Show instance of Ratio is different from that in Yhc/Hugs/The
Report. There has been a discussion in the bug tracker, which you can
follow at . I thought
I'd summarise everyone's positions, and the possible actions we can


showing a Ratio using GHC places no spaces around the "%", in
Hugs/Yhc/The Report it has spaces. Read the bug tracker for an


EITHER: Make all compilers put out spaces
OR: Make no compilers put out spaces

The alternative is to have different compilers do different things,
which I think we can agree is bad (TM).

As a more general point, should all infix constructors have spaces
around them or not. Whatever we decide, it would be weird for it to
apply to only the Ratio instance and not others.

I think we should solve this problem now. It makes sense to come to
some consensus which Haskell' will follow, then fix whichever set of
compilers is determined to be wrong.


The basic differing of opinions is should Show print the minimal ASCII
representation (Neil Mitchell, Simon Marlow) or something that is
slightly pretty where possible (Ross Patterson, Ian Lynagh).

Comments welcome.



More information about the Haskell-prime mailing list