X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Ftests%2Fnumeric%2Fshould_run%2Farith008.hs;h=b9e3ff5168cd47b70ab63a3930fe5b3bb11b2b03;hb=5e5ec077e402a4924d8ef48b40fc11f144487acc;hp=73bbd71f331182cf6e064f773e97fe0dc9f18cbc;hpb=7f9b96f5ee1ef690c35dc98747796d69c52393ae;p=ghc-hetmet.git diff --git a/ghc/tests/numeric/should_run/arith008.hs b/ghc/tests/numeric/should_run/arith008.hs index 73bbd71..b9e3ff5 100644 --- a/ghc/tests/numeric/should_run/arith008.hs +++ b/ghc/tests/numeric/should_run/arith008.hs @@ -1,6 +1,7 @@ --!!! a random test from Nick North -- (got this in mid-1993; don't remember why. WDP 95/02) -- + random_numbers :: (Int, Int, Int) -> [Float] random_numbers (s1,s2,s3) = map (snd . properFraction . combine) (iterate f (s1,s2,s3)) @@ -13,8 +14,11 @@ random_numbers (s1,s2,s3) ((171*a) `mod` 30269, (172*b) `mod` 30307, (170*c) `mod` 30323) -- partain: changed to cvt spaces into newlines (easier to see bugs) +-- sof: define approp. version of showList to do this. +main = putStr (showL (showsPrec 0) (take 1000 (random_numbers (9807, 65, 32975))) "\n") -main = putStr (map cvt (shows (take 1000 (random_numbers (9807, 65, 32975))) "\n")) +showL showx [] = showString "[]" +showL showx (x:xs) = showChar '[' . showx x . showl xs where - cvt ' ' = '\n' - cvt c = c + showl [] = showChar ']' + showl (x:xs) = showString ",\n" . showx x . showl xs