parconc-examples 0.4 → 0.4.1
raw patch · 4 files changed
+51/−2 lines, 4 filesnew-component:exe:findpar5
Files
- ChangeLog.md +4/−0
- README.md +25/−0
- findpar5.hs +9/−1
- parconc-examples.cabal +13/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+# Version 0.4.1++* Make findpar5.hs compile, and add it to the .cabal file+ # Version 0.4 * Add `stack.yaml`, builds using LTS 4.2 (GHC 7.10.3)
+ README.md view
@@ -0,0 +1,25 @@+This is the sample code to accompany the book *Parallel and Concurrent Programming in Haskell* (Simon Marlow, O'Reilly 2013).++To build the code on your system, you need either:++* [Stack](http://haskellstack.org)+* [A Minimal GHC installation](https://www.haskell.org/downloads)+* [The Haskell Platform](https://www.haskell.org/downloads#platform)++## Building with Stack++```+stack build+```++will build all the executables and install them in a platform-specific+subdirectory under `.stack-work/install`.++## Building with Cabal++```+cabal sandox init+cabal install --only-dependencies+cabal configure+cabal build+```
findpar5.hs view
@@ -1,13 +1,14 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} import System.Directory import Control.Concurrent+import Control.Monad import System.FilePath import System.Environment import Data.List hiding (find) import GHC.Conc (getNumCapabilities) import Text.Printf -import qualified Control.Monad.Par as P hiding (runParIO)+import qualified Control.Monad.Par.Class as P hiding (runParIO) import Control.Monad.Par.IO import Control.Monad.IO.Class @@ -62,6 +63,13 @@ -- newtype EParIO a = E { unE :: ParIO (Either SomeException a) }++instance Functor EParIO where+ fmap f e = e >>= return . f++instance Applicative EParIO where+ pure = return+ (<*>) = ap instance Monad EParIO where return a = E (return (Right a))
parconc-examples.cabal view
@@ -1,5 +1,5 @@ name: parconc-examples-version: 0.4+version: 0.4.1 synopsis: Examples to accompany the book "Parallel and Concurrent Programming in Haskell" -- description: license: BSD3@@ -33,6 +33,7 @@ tmvar.hs windowman.hs ChangeLog.md+ README.md -- ----------------------------------------------------------------------------- -- Flags@@ -733,6 +734,17 @@ , directory >= 1.1 && < 1.3 , async ==2.0.* , stm ==2.4.*+ , transformers >=0.3 && <0.5+ , abstract-par ==0.3.*+ , monad-par >= 0.3.4 && < 0.4+ default-language: Haskell2010++executable findpar5+ main-is: findpar5.hs+ ghc-options: -threaded+ build-depends: base >= 4.5 && < 4.9+ , filepath >= 1.3 && < 1.5+ , directory >= 1.1 && < 1.3 , transformers >=0.3 && <0.5 , abstract-par ==0.3.* , monad-par >= 0.3.4 && < 0.4