[ create a new paste ] login | about

Link: http://codepad.org/ehLwYrjL    [ raw code | fork ]

Haskell, pasted on Oct 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Main where

import ProjectEuler
import Control.Parallel.Strategies




-- This runs slower on multiple processes. Wat

solved = [1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,18,20,21,22,25,28,29,30,34,35,36,37,40,41,48,53,56,67,71,73,99]
main = do
	results <- fmap (`using` parList rseq) $ mapM euler solved
	-- Note: Why doesn't rseq parallelize correctly here? results::[Integer], so it should work ...
	mapM_ (putStrLn . show) $ zip solved results


Create a new paste based on this one


Comments: