packages feed

Parallel-Arrows-Multicore (empty) → 0.1.1.0

raw patch · 9 files changed

+321/−0 lines, 9 filesdep +Parallel-Arrows-BaseSpecdep +Parallel-Arrows-Definitiondep +Parallel-Arrows-Multicoresetup-changed

Dependencies added: Parallel-Arrows-BaseSpec, Parallel-Arrows-Definition, Parallel-Arrows-Multicore, base, deepseq, hspec, parallel, split

Files

+ LICENSE.md view
@@ -0,0 +1,23 @@+[The MIT License (MIT)][]++Copyright (c) 2017 Martin Braun++Permission is hereby granted, free of charge, to any person obtaining a copy of+this software and associated documentation files (the "Software"), to deal in+the Software without restriction, including without limitation the rights to+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies+of the Software, and to permit persons to whom the Software is furnished to do+so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.++[The MIT License (MIT)]: https://opensource.org/licenses/MIT
+ Parallel-Arrows-Multicore.cabal view
@@ -0,0 +1,63 @@+-- This file has been generated from package.yaml by hpack version 0.20.0.+--+-- see: https://github.com/sol/hpack+--+-- hash: b3a28531a690aa75424a58102595fed4c11eafaaecce8080b723b1f0d6863f7b++name:           Parallel-Arrows-Multicore+version:        0.1.1.0+synopsis:       GpH based backend for @Parallel-Arrows-Definition@ in a multicore variant.+description:    GpH based backend for @Parallel-Arrows-Definition@ in a multicore variant. Use this backend for shared-memory programs.+category:       Parallelism,Arrows+homepage:       https://github.com/s4ke/Parrows#readme+bug-reports:    https://github.com/s4ke/Parrows/issues+maintainer:     Martin Braun+license:        MIT+license-file:   LICENSE.md+build-type:     Simple+cabal-version:  >= 1.10++extra-source-files:+    package.yaml+    stack.yaml++source-repository head+  type: git+  location: https://github.com/s4ke/Parrows++library+  hs-source-dirs:+      src/main+  ghc-options: -Wall+  build-depends:+      Parallel-Arrows-Definition ==0.1.1.0+    , base >=4.7 && <5.0+    , deepseq+    , parallel+    , split+  exposed-modules:+      Parrows.Multicore+      Parrows.Multicore.Simple+  other-modules:+      Paths_Parallel_Arrows_Multicore+  default-language: Haskell2010++test-suite spec+  type: exitcode-stdio-1.0+  main-is: Spec.hs+  hs-source-dirs:+      src/test+  ghc-options: -Wall+  build-depends:+      Parallel-Arrows-BaseSpec ==0.1.1.0+    , Parallel-Arrows-Definition ==0.1.1.0+    , Parallel-Arrows-Multicore+    , base+    , deepseq+    , hspec ==2.*+    , parallel+    , split+  other-modules:+      MulticoreSpec+      Paths_Parallel_Arrows_Multicore+  default-language: Haskell2010
+ Setup.hs view
@@ -0,0 +1,7 @@+-- This script is used to build and install your package. Typically you don't+-- need to change it. The Cabal documentation has more information about this+-- file: <https://www.haskell.org/cabal/users-guide/installing-packages.html>.+import qualified Distribution.Simple++main :: IO ()+main = Distribution.Simple.defaultMain
+ package.yaml view
@@ -0,0 +1,39 @@+# This YAML file describes your package. Stack will automatically generate a+# Cabal file when you run `stack build`. See the hpack website for help with+# this file: <https://github.com/sol/hpack>.+category: Parallelism,Arrows+description: GpH based backend for @Parallel-Arrows-Definition@ in a multicore variant.+  Use this backend for shared-memory programs.+extra-source-files:+- package.yaml+- stack.yaml+ghc-options: -Wall+github: s4ke/Parrows+library:+  dependencies:+  - base >= 4.7 && < 5.0+  - deepseq+  - parallel+  - split+  - Parallel-Arrows-Definition == 0.1.1.0+  source-dirs: src/main+tests:+  spec:+    source-dirs:+      - src/test+    main: Spec.hs+    dependencies:+      - hspec == 2.*+      - base+      - deepseq+      - parallel+      - split+      - Parallel-Arrows-Definition == 0.1.1.0+      - Parallel-Arrows-BaseSpec == 0.1.1.0+      - Parallel-Arrows-Multicore+license: MIT+license-file: LICENSE.md+maintainer: Martin Braun+name: Parallel-Arrows-Multicore+synopsis: GpH based backend for @Parallel-Arrows-Definition@ in a multicore variant.+version: '0.1.1.0'
+ src/main/Parrows/Multicore.hs view
@@ -0,0 +1,66 @@+{-+The MIT License (MIT)++Copyright (c) 2016-2017 Martin Braun++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+-}+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE UndecidableInstances  #-}+module Parrows.Multicore(+  Strategy,+  Conf(..),+  defaultConf,+  stratToConf,+  module Parrows.Definition,+  module Parrows.Future,+  module Control.DeepSeq+) where++import           Parrows.Definition+import           Parrows.Future+import           Parrows.Util++import           Control.Arrow+import           Control.DeepSeq+import           Control.Parallel+import           Control.Parallel.Strategies++data Conf a = Conf (Strategy a)++defaultConf :: (NFData b) => [arr a b] -> Conf b+defaultConf fs = stratToConf fs rdeepseq++stratToConf :: [arr a b] -> Strategy b -> Conf b+stratToConf _ strat = Conf strat++instance (ArrowChoice arr) => ArrowParallel arr a b (Conf b) where+    parEvalN (Conf strat) fs =+        evalN fs >>>+        arr (withStrategy (parList strat))++instance (ArrowChoice arr, ArrowParallel arr a b (Conf b)) => ArrowLoopParallel arr a b (Conf b) where+    loopParEvalN _ = evalN+    postLoopParEvalN = parEvalN++instance Future BasicFuture a (Conf a) where+    put _ = put'+    get _ = get'
+ src/main/Parrows/Multicore/Simple.hs view
@@ -0,0 +1,43 @@+{-+The MIT License (MIT)++Copyright (c) 2016-2017 Martin Braun++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+-}+{-# LANGUAGE FlexibleContexts      #-}+{-# LANGUAGE UndecidableInstances  #-}+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+module Parrows.Multicore.Simple where++import Parrows.Multicore+import Control.Arrow++instance (NFData b, ArrowChoice arr, ArrowParallel arr a b (Conf b)) => ArrowParallel arr a b () where+    parEvalN _ fs = parEvalN (defaultConf fs) fs++instance (NFData b, ArrowChoice arr, ArrowParallel arr a b (), ArrowLoopParallel arr a b (Conf b)) => ArrowLoopParallel arr a b () where+    loopParEvalN _ fs = loopParEvalN (defaultConf fs) fs+    postLoopParEvalN _  fs = postLoopParEvalN (defaultConf fs) fs++instance Future BasicFuture b () where+    put _ = put'+    get _ = get'
+ src/test/MulticoreSpec.hs view
@@ -0,0 +1,11 @@+module MulticoreSpec(spec) where++import Parrows.Multicore.Simple()++import BaseSpec.CompleteSpecBase++import Test.Hspec++spec :: Spec+spec = describe "Multicore PArrows Check" $ do+    specBase
+ src/test/Spec.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
+ stack.yaml view
@@ -0,0 +1,68 @@+# This file was automatically generated by 'stack init'+#+# Some commonly used options have been documented as comments in this file.+# For advanced use and comprehensive documentation of the format, please see:+# http://docs.haskellstack.org/en/stable/yaml_configuration/++# Resolver to choose a 'specific' stackage snapshot or a compiler version.+# A snapshot resolver dictates the compiler version and the set of packages+# to be used for project dependencies. For example:+#+# resolver: lts-3.5+# resolver: nightly-2015-09-21+# resolver: ghc-7.10.2+# resolver: ghcjs-0.1.0_ghc-7.10.2+# resolver:+#  name: custom-snapshot+#  location: "./custom-snapshot.yaml"+resolver: lts-7.1++# User packages to be built.+# Various formats can be used as shown in the example below.+#+# packages:+# - some-directory+# - https://example.com/foo/bar/baz-0.0.2.tar.gz+# - location:+#    git: https://github.com/commercialhaskell/stack.git+#    commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a+# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a+#   extra-dep: true+#  subdirs:+#  - auto-update+#  - wai+#+# A package marked 'extra-dep: true' will only be built if demanded by a+# non-dependency (i.e. a user package), and its test suites and benchmarks+# will not be run. This is useful for tweaking upstream packages.+packages:+- ../Definition+- ../BaseSpec+- '.'+# Dependency packages to be pulled from upstream that are not in the resolver+# (e.g., acme-missiles-0.3)+extra-deps: []++# Override default flag values for local packages and extra-deps+flags: {}++# Extra package databases containing global packages+extra-package-dbs: []++# Control whether we use the GHC we find on the path+# system-ghc: true+#+# Require a specific version of stack, using version ranges+# require-stack-version: -any # Default+# require-stack-version: ">=1.1"+#+# Override the architecture used by stack, especially useful on Windows+# arch: i386+# arch: x86_64+#+# Extra directories used by stack for building+# extra-include-dirs: [/path/to/dir]+# extra-lib-dirs: [/path/to/dir]+#+# Allow a newer minor version of GHC than the snapshot specifies+# compiler-check: newer-minor