Skip to content

Instantly share code, notes, and snippets.

@opqdonut
Forked from anonymous/par.hs
Last active November 17, 2015 20:28
Show Gist options
  • Select an option

  • Save opqdonut/a8fd622f4adf576b9c4e to your computer and use it in GitHub Desktop.

Select an option

Save opqdonut/a8fd622f4adf576b9c4e to your computer and use it in GitHub Desktop.
import Control.Parallel.Strategies
factorial :: Integer -> Integer
factorial n = product [1..n]
f = length . show . factorial
main = print result
where result = map f [n+100,n+99..n] `using` parList rseq
n = 50*1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment