Bagley shootout. Was: Lightningspeed haskell

Jan Kort kort@wins.uva.nl
Fri, 02 Mar 2001 13:46:18 +0100


Reducing the 46M reported on the shootout without changing the
program would be interesting. An easy way for improvement
would be to share characters and small integers like is done in Hugs.
This would mean the initial list of characters would be reduced from
40M to 24M, so the total should go down from 46M to 30M.

Reducing the 200M would be much harder, even with changing the
program I can't get lower than 120M:

f :: String -> String -> String
f ys []        = ys
f ys ('\n':xs) = '\n':ys ++ (f [] xs)
f ys (x:xs)    = f (x:ys) xs

main :: IO()
main = interact $ reverse . (f [])

  Jan