FR
importPour l'utiliser : import Data.Parallel

Data.Parallel — deterministic data-parallel combinators (parMap / parReduce)

Synopsis
parMap : (a -> b) -> List a -> List b

Map a PURE function over a list, data-parallel. parMap f xs ≡ map f xs — same result, same order. f must be pure: an effectful function's effects are PACKAGED into the result, never performed here (the purity contract above). v1 runs sequentially; a future increment parallelises without changing this API.

parReduce : (a -> a -> a) -> a -> List a -> a

Reduce a list with an ASSOCIATIVE operator op and its identity z, data-parallel. parReduce op z xs ≡ foldl op z xs; because op is associative with identity z, this also equals foldr op z xs and every balanced regrouping, so the result does not depend on how the reduction is split. The caller is responsible for op being associative and z a two-sided identity — e.g. parReduce (+) 0, parReduce (*) 1, parReduce (<>) mempty. (For other op/z the value is still foldl op z xs, but the parallel-invariance law does not hold.) Constant stack. v1 runs sequentially.