I read several tutorials on Haskell. However, I could not get the compiled application to work on a multi-core (I have Intel Quad Core) windows (32 bit) .
I have tried several things:
But no luck.
A compiled application only works on one core, only 100%.
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)
source
share