Tomasz Zielonka writes:

 >> wc :: String -> (Int, Int, Int)
 >> wc file = ( length (lines file)
 >>           , length (words file)
 >>           , length file
 >>           )
 >
 > I have a crazy idea: what if we computed all three length
 > applications concurrently, with the RTS preempting the
 > thread when it generates too much unreclaimable nodes?

That's a pretty good idea, actually. What is the state of
the 'par' primitive in GHC 6.x? Now that I think of it, it
seems that adding a proper "compute in parallel" annotation
could make a big difference in this case.

Peter

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to