I've been reading a number of tutorials on Haskell. However, I have not been able to get the compiled application to run on a multicore (I have an Intel Quad Core) on windows (32 bit).
I have tried a number of things:
But no luck.
The compiled application runs 100% on one core only.
Any ideas?
Code:
import Control.Parallel
import Control.Monad
import Text.Printf
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = l `pseq` r `pseq` l+r
where
l = fib (n-1)
r = fib (n-2)
main = forM_ [0..350] $ \i ->
printf "n=%d => %d\n" i (fib i)