parallel 3.2.0.3 → 3.2.0.4
raw patch · 4 files changed
+84/−56 lines, 4 filesdep ~arraydep ~basedep ~containersnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: array, base, containers
API changes (from Hackage documentation)
Files
- Control/Parallel.hs +5/−3
- Control/Parallel/Strategies.hs +32/−30
- changelog +8/−0
- parallel.cabal +39/−23
Control/Parallel.hs view
@@ -1,9 +1,11 @@+{-# LANGUAGE CPP #-}+ ----------------------------------------------------------------------------- -- | -- Module : Control.Parallel -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer : libraries@haskell.org -- Stability : stable -- Portability : portable@@ -17,7 +19,7 @@ ) where #ifdef __GLASGOW_HASKELL__-import qualified GHC.Conc ( par, pseq )+import qualified GHC.Conc ( par, pseq ) infixr 0 `par`, `pseq` #endif@@ -27,7 +29,7 @@ -- | Indicates that it may be beneficial to evaluate the first -- argument in parallel with the second. Returns the value of the -- second argument.--- +-- -- @a ``par`` b@ is exactly equivalent semantically to @b@. -- -- @par@ is generally used when the value of @a@ is likely to be
Control/Parallel/Strategies.hs view
@@ -1,10 +1,10 @@-{-# LANGUAGE MagicHash, UnboxedTuples #-}+{-# LANGUAGE BangPatterns, CPP, MagicHash, UnboxedTuples #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Parallel.Strategies -- Copyright : (c) The University of Glasgow 2001-2010 -- License : BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer : libraries@haskell.org -- Stability : experimental -- Portability : portable@@ -29,7 +29,7 @@ -- -- * 'Monad' and 'Applicative' instances are provided, for quickly building -- strategies that involve traversing structures in a regular way.--- +-- -- For API history and changes in this release, see "Control.Parallel.Strategies#history". -----------------------------------------------------------------------------@@ -121,7 +121,7 @@ -- $history -- * Backwards compatibility- + -- | These functions and types are all deprecated, and will be -- removed in a future release. In all cases they have been -- either renamed or replaced with equivalent functionality.@@ -156,7 +156,7 @@ -- Eval monad (isomorphic to Lift monad from MonadLib 3.6.1) -- | 'Eval' is a Monad that makes it easier to define parallel--- strategies. It is a strict identity monad: that is, in +-- strategies. It is a strict identity monad: that is, in -- -- > m >>= f --@@ -258,7 +258,7 @@ -- | A 'Strategy' is a function that embodies a parallel evaluation strategy. -- The function traverses (parts of) its argument, evaluating subexpressions -- in parallel or in sequence.--- +-- -- A 'Strategy' may do an arbitrary amount of evaluation of its -- argument, but should not return a value different from the one it -- was passed.@@ -269,7 +269,7 @@ -- intention is that the program applies the 'Strategy' to a -- structure, and then uses the returned value, discarding the old -- value. This idiom is expressed by the 'using' function.--- +-- type Strategy a = a -> Eval a -- | Evaluate a value using the given 'Strategy'.@@ -281,11 +281,11 @@ -- | evaluate a value using the given 'Strategy'. This is simply -- 'using' with the arguments reversed.--- +-- withStrategy :: Strategy a -> a -> a withStrategy = flip using --- | Compose two strategies sequentially. +-- | Compose two strategies sequentially. -- This is the analogue to function composition on strategies. -- -- > strat2 `dot` strat1 == strat2 . withStrategy strat1@@ -411,7 +411,7 @@ -- -------------------------------------------------------------------------- -- Strategy combinators for Traversable data types --- | Evaluate the elements of a traversable data structure +-- | Evaluate the elements of a traversable data structure -- according to the given strategy. evalTraversable :: Traversable t => Strategy a -> Strategy (t a) evalTraversable = traverse@@ -506,7 +506,8 @@ -- The non-compositional 'parListWHNF' might be more efficient than its -- more compositional counterpart; use RULES to do the specialisation. -{-# RULES +{-# NOINLINE [1] parList #-}+{-# RULES "parList/rseq" parList rseq = parListWHNF #-} @@ -518,7 +519,7 @@ -- > parMap strat f = withStrategy (parList strat) . map f -- parMap :: Strategy b -> (a -> b) -> [a] -> [b]-parMap strat f = (`using` parList strat) . map f +parMap strat f = (`using` parList strat) . map f -- -------------------------------------------------------------------------- -- Strategies for lazy lists@@ -542,7 +543,7 @@ -- 'evalBuffer' is not as compositional as the type suggests. In fact, -- it evaluates list elements at least to weak head normal form, -- disregarding a strategy argument 'r0'.--- +-- -- > evalBuffer n r0 == evalBuffer n rseq -- evalBuffer :: Int -> Strategy a -> Strategy [a]@@ -573,7 +574,9 @@ -- Deforest the intermediate list in parBuffer/evalBuffer when it is -- unnecessary: -{-# RULES +{-# NOINLINE [1] evalBuffer #-}+{-# NOINLINE [1] parBuffer #-}+{-# RULES "evalBuffer/rseq" forall n . evalBuffer n rseq = evalBufferWHNF n "parBuffer/rseq" forall n . parBuffer n rseq = parBufferWHNF n #-}@@ -666,34 +669,34 @@ f $|| s = \ x -> let z = x `using` s in z `par` f z -- | Sequential function composition. The result of--- the second function is evaluated using the given strategy, +-- the second function is evaluated using the given strategy, -- and then given to the first function. (.|) :: (b -> c) -> Strategy b -> (a -> b) -> (a -> c)-(.|) f s g = \ x -> let z = g x `using` s in +(.|) f s g = \ x -> let z = g x `using` s in z `pseq` f z -- | Parallel function composition. The result of the second -- function is evaluated using the given strategy, -- in parallel with the application of the first function. (.||) :: (b -> c) -> Strategy b -> (a -> b) -> (a -> c)-(.||) f s g = \ x -> let z = g x `using` s in +(.||) f s g = \ x -> let z = g x `using` s in z `par` f z --- | Sequential inverse function composition, +-- | Sequential inverse function composition, -- for those who read their programs from left to right.--- The result of the first function is evaluated using the +-- The result of the first function is evaluated using the -- given strategy, and then given to the second function. (-|) :: (a -> b) -> Strategy b -> (b -> c) -> (a -> c)-(-|) f s g = \ x -> let z = f x `using` s in +(-|) f s g = \ x -> let z = f x `using` s in z `pseq` g z -- | Parallel inverse function composition, -- for those who read their programs from left to right.--- The result of the first function is evaluated using the --- given strategy, in parallel with the application of the +-- The result of the first function is evaluated using the+-- given strategy, in parallel with the application of the -- second function. (-||) :: (a -> b) -> Strategy b -> (b -> c) -> (a -> c)-(-||) f s g = \ x -> let z = f x `using` s in +(-||) f s g = \ x -> let z = f x `using` s in z `par` g z -- -----------------------------------------------------------------------------@@ -715,12 +718,12 @@ {-# DEPRECATED (>|) "Use pseq or $| instead" #-} -- | DEPRECATED: Use 'pseq' or '$|' instead-(>|) :: Done -> Done -> Done +(>|) :: Done -> Done -> Done (>|) = Prelude.seq {-# DEPRECATED (>||) "Use par or $|| instead" #-} -- | DEPRECATED: Use 'par' or '$||' instead-(>||) :: Done -> Done -> Done +(>||) :: Done -> Done -> Done (>||) = par {-# DEPRECATED rwhnf "renamed to rseq" #-}@@ -781,7 +784,7 @@ The original Strategies design is described in /Algorithm + Strategy = Parallelism/ <http://www.macs.hw.ac.uk/~dsg/gph/papers/html/Strategies/strategies.html> and the code was written by- Phil Trinder, Hans-Wolfgang Loidl, Kevin Hammond et al. + Phil Trinder, Hans-Wolfgang Loidl, Kevin Hammond et al. Version 2.x @@ -845,7 +848,7 @@ (version 2.3 was not released on Hackage). Version 3 introduced a major overhaul of the API, to match what is-presented in the paper +presented in the paper /Seq no More: Better Strategies for Parallel Haskell/ <http://www.haskell.org/~simonmar/papers/strategies.pdf>@@ -857,14 +860,14 @@ * Changes to the naming scheme: 'rwhnf' renamed to 'rseq', 'seqList' renamed to 'evalList', 'seqPair' renamed to- 'evalTuple2', + 'evalTuple2', The naming scheme is now as follows: * Basic polymorphic strategies (of type @'Strategy' a@) are called @r...@. Examples: 'r0', 'rseq', 'rpar', 'rdeepseq'. - * A strategy combinator for a particular type constructor + * A strategy combinator for a particular type constructor or constructor class @T@ is called @evalT...@, @parT...@ or @seqT...@. * The @seqT...@ combinators (residing in module@@ -888,4 +891,3 @@ 'parBuffer', which are not named after their type constructor (lists) but after their function (rolling buffer of fixed size). -}-
+ changelog view
@@ -0,0 +1,8 @@+-*-change-log-*-++3.2.0.4 Nov 2013+ * Update package description to Cabal 1.10 format+ * Add support for GHC 7.8+ * Drop support for GHCs older than GHC 7.0.1+ * Add NOINLINE pragmas to `parBuffer`, `parList`, and `evalBuffer`+ to make RULEs more likely to fire
parallel.cabal view
@@ -1,33 +1,49 @@-name: parallel-version: 3.2.0.3-license: BSD3-license-file: LICENSE-maintainer: libraries@haskell.org-synopsis: Parallel programming library+name: parallel+version: 3.2.0.4+license: BSD3+license-file: LICENSE+maintainer: libraries@haskell.org+synopsis: Parallel programming library+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 description: This package provides a library for parallel programming.-category: Control-build-type: Simple-cabal-version: >=1.6 +extra-source-files: changelog+ source-repository head type: git- location: http://darcs.haskell.org/packages/parallel.git/+ location: http://git.haskell.org/packages/parallel.git -library {- exposed-modules:+source-repository this+ type: git+ location: http://git.haskell.org/packages/parallel.git+ tag: parallel-3.2.0.4-release++library+ default-language: Haskell2010+ other-extensions:+ BangPatterns+ CPP+ FlexibleInstances+ MagicHash+ UnboxedTuples++ exposed-modules: Control.Seq Control.Parallel Control.Parallel.Strategies- extensions: CPP BangPatterns- build-depends: base >= 3 && < 5,- deepseq >= 1.1 && < 1.4,- containers >= 0.1 && < 0.6,- array >= 0.1 && < 0.5- ghc-options: -Wall - if impl(ghc >= 6.11) {- -- To improve parallel performance:- ghc-options: -feager-blackholing- }-}+ build-depends:+ array >= 0.3 && < 0.6,+ base >= 4.3 && < 4.8,+ containers >= 0.4 && < 0.6,+ deepseq >= 1.1 && < 1.4++ ghc-options: -Wall++ if impl(ghc >= 6.11)+ -- To improve parallel performance:+ ghc-options: -feager-blackholing