swh:1:snp:36f6853f4c867e5bf757ecdd45b41d7d9a561f40
Raw File
Tip revision: a6c89f015584a2cc2f3b01356b0d6ed5cd0f0a67 authored by Simon Marlow on 08 November 2021, 09:52:23 UTC
Merge pull request #34 from ehigham/master
Tip revision: a6c89f0
parlist.hs
module ParList where

import Control.Parallel.Strategies hiding (parList, evalList)

-- <<evalList
evalList :: Strategy a -> Strategy [a]
evalList strat []     = return []
evalList strat (x:xs) = do
  x'  <- strat x
  xs' <- evalList strat xs
  return (x':xs')
-- >>

-- <<parList
parList :: Strategy a -> Strategy [a]
parList strat = evalList (rparWith strat)
-- >>
back to top