[Haskell-cafe] Showing Data.Ratio - different on GHC vs Hugs/Yhc

David Menendez dave at zednenem.com
Fri Nov 16 20:41:46 EST 2007


On Nov 16, 2007 2:12 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:
> Under Hugs and Yhc, showing a Ratio 1%2 gives "1 % 2". Under GHC
> showing 1%2 gives "1%2". Does the standard say anything about this? Is
> someone wrong? And how do Yhc/nhc/Hugs pass Bernouilli in the Nofib
> suite given that the output doesn't match?

Judging by the Read instance, the whitespace isn't considered significant.

Prelude Data.Ratio> map read ["1%2", "1 % 2", " 1   %   2 "] :: [Rational]
[1%2,1%2,1%2]


-- 
Dave Menendez <dave at zednenem.com>
<http://www.eyrie.org/~zednenem/>


More information about the Haskell-Cafe mailing list