parallel 3.2.0.6 → 3.2.1.0
raw patch · 4 files changed
+42/−18 lines, 4 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- Control.Parallel.Strategies: instance Applicative Eval
- Control.Parallel.Strategies: instance Functor Eval
- Control.Parallel.Strategies: instance Monad Eval
+ Control.Parallel.Strategies: instance GHC.Base.Applicative Control.Parallel.Strategies.Eval
+ Control.Parallel.Strategies: instance GHC.Base.Functor Control.Parallel.Strategies.Eval
+ Control.Parallel.Strategies: instance GHC.Base.Monad Control.Parallel.Strategies.Eval
- Control.Parallel.Strategies: rpar :: a -> Eval a
+ Control.Parallel.Strategies: rpar :: Strategy a
Files
- Control/Parallel/Strategies.hs +21/−14
- Control/Seq.hs +10/−0
- changelog.md +8/−0
- parallel.cabal +3/−4
Control/Parallel/Strategies.hs view
@@ -201,8 +201,15 @@ runEval :: Eval a -> a runEval (Eval x) = case x realWorld# of (# _, a #) -> a +instance Functor Eval where+ fmap = liftM++instance Applicative Eval where+ pure x = Eval $ \s -> (# s, x #)+ (<*>) = ap+ instance Monad Eval where- return x = Eval $ \s -> (# s, x #)+ return = pure Eval x >>= k = Eval $ \s -> case x s of (# s', a #) -> case k a of Eval f -> f s'@@ -214,8 +221,15 @@ runEval :: Eval a -> a runEval (Done x) = x +instance Functor Eval where+ fmap = liftM++instance Applicative Eval where+ pure = Done+ (<*>) = ap+ instance Monad Eval where- return x = Done x+ return = pure Done x >>= k = lazy (k x) -- Note: pattern 'Done x' makes '>>=' strict {-# RULES "lazy Done" forall x . lazy (Done x) = Done x #-}@@ -223,14 +237,6 @@ #endif -instance Functor Eval where- fmap = liftM--instance Applicative Eval where- (<*>) = ap- pure = return-- -- The Eval monad satisfies the monad laws. -- -- (1) Left identity:@@ -323,7 +329,7 @@ evalSeq :: SeqStrategy a -> Strategy a evalSeq strat x = strat x `pseq` return x --- | a name for @Control.Seq.Strategy@, for documetnation only.+-- | A name for @Control.Seq.Strategy@, for documentation only. type SeqStrategy a = Control.Seq.Strategy a -- --------------------------------------------------------------------------@@ -380,7 +386,7 @@ -- == rdeepseq -- | 'rpar' sparks its argument (for evaluation in parallel).-rpar :: a -> Eval a+rpar :: Strategy a #if __GLASGOW_HASKELL__ >= 702 rpar x = Eval $ \s -> spark# x s #else@@ -509,6 +515,7 @@ -- more compositional counterpart; use RULES to do the specialisation. {-# NOINLINE [1] parList #-}+{-# NOINLINE [1] rseq #-} {-# RULES "parList/rseq" parList rseq = parListWHNF #-}@@ -794,7 +801,7 @@ parallelism in GHC, we discovered that the original formulation of Strategies had some problems, in particular it lead to space leaks and difficulties expressing speculative parallelism. Details are in-the paper /Runtime Support for Multicore Haskell/ <http://www.haskell.org/~simonmar/papers/multicore-ghc.pdf>.+the paper /Runtime Support for Multicore Haskell/ <http://community.haskell.org/~simonmar/papers/multicore-ghc.pdf>. This module has been rewritten in version 2. The main change is to the 'Strategy a' type synonym, which was previously @a -> Done@ and@@ -853,7 +860,7 @@ presented in the paper /Seq no More: Better Strategies for Parallel Haskell/- <http://www.haskell.org/~simonmar/papers/strategies.pdf>+ <http://community.haskell.org/~simonmar/papers/strategies.pdf> The major differenes in the API are:
Control/Seq.hs view
@@ -66,7 +66,9 @@ #endif import Data.Map (Map) import qualified Data.Map (toList)+#if !((__GLASGOW_HASKELL__ >= 711) && MIN_VERSION_array(0,5,1)) import Data.Ix (Ix)+#endif import Data.Array (Array) import qualified Data.Array (bounds, elems) @@ -146,11 +148,19 @@ -- | Evaluate the elements of an array according to the given strategy. -- Evaluation of the array bounds may be triggered as a side effect.+#if (__GLASGOW_HASKELL__ >= 711) && MIN_VERSION_array(0,5,1)+seqArray :: Strategy a -> Strategy (Array i a)+#else seqArray :: Ix i => Strategy a -> Strategy (Array i a)+#endif seqArray strat = seqList strat . Data.Array.elems -- | Evaluate the bounds of an array according to the given strategy.+#if (__GLASGOW_HASKELL__ >= 711) && MIN_VERSION_array(0,5,1)+seqArrayBounds :: Strategy i -> Strategy (Array i a)+#else seqArrayBounds :: Ix i => Strategy i -> Strategy (Array i a)+#endif seqArrayBounds strat = seqTuple2 strat strat . Data.Array.bounds -- | Evaluate the keys and values of a map according to the given strategies.
changelog.md view
@@ -1,5 +1,13 @@ # Changelog for [`parallel` package](http://hackage.haskell.org/package/parallel) +## 3.2.1.0 *Jan 2016*++ - Support `base-4.9.0.0`+ - Add `{-# NOINLINE[1] rseq #-}` to make the `RULE` more robust+ - Fix broken links to papers in Haddock+ - Make `rpar` type signature consistent with `rseq` via type-synonym+ - Drop redundant `Ix`-constraint on `seqArray`/`seqArrayBounds` for GHC >= 8.0+ ## 3.2.0.6 *Dec 2014* - Make `-Wall` message free for all supported `base` versions
parallel.cabal view
@@ -1,5 +1,5 @@ name: parallel-version: 3.2.0.6+version: 3.2.1.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE@@ -9,7 +9,7 @@ category: Control, Parallelism build-type: Simple cabal-version: >=1.10-tested-with: GHC==7.6.3, GHC==7.6.2, GHC==7.6.1, GHC==7.4.2, GHC==7.4.1, GHC==7.2.2, GHC==7.2.1, GHC==7.0.4, GHC==7.0.3, GHC==7.0.2, GHC==7.0.1+tested-with: GHC==8.0.1, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 description: This package provides a library for parallel programming. @@ -24,7 +24,6 @@ other-extensions: BangPatterns CPP- FlexibleInstances MagicHash UnboxedTuples @@ -35,7 +34,7 @@ build-depends: array >= 0.3 && < 0.6,- base >= 4.3 && < 4.9,+ base >= 4.3 && < 4.10, containers >= 0.4 && < 0.6, deepseq >= 1.1 && < 1.5