packages feed

Parallel-Arrows-Eden (empty) → 0.1.1.0

raw patch · 6 files changed

+207/−0 lines, 6 filesdep +Parallel-Arrows-BaseSpecdep +Parallel-Arrows-Definitiondep +Parallel-Arrows-Edensetup-changed

Dependencies added: Parallel-Arrows-BaseSpec, Parallel-Arrows-Definition, Parallel-Arrows-Eden, QuickCheck, base, deepseq, edenmodules, 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-Eden.cabal view
@@ -0,0 +1,60 @@+-- This file has been generated from package.yaml by hpack version 0.14.0.+--+-- see: https://github.com/sol/hpack++-- modified file from ../Parrows.cabal++name:           Parallel-Arrows-Eden+version:        0.1.1.0+synopsis:       Eden based backend for @Parallel-Arrows-Definition@.+description:    Eden based backend for @Parallel-Arrows-Definition@.+                This backend works on shared-memory (compile with -parcp) systems or on clusters (only -parmpi was tested).+                For parallel evaluation on clusters you will have to compile your own Eden GHC (http://www.mathematik.uni-marburg.de/~eden/).+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:++source-repository head+  type: git+  location: https://github.com/s4ke/Parrows++Test-Suite spec+    Type:                 exitcode-stdio-1.0+    Default-Language:     Haskell2010+    Hs-Source-Dirs:       src/test+    Ghc-Options:          -Wall -parcp+    Main-Is:              Spec.hs+    Build-Depends:        base >= 4.7 && < 5.0+                        , hspec+                        , QuickCheck+                        , base+                        , deepseq+                        , parallel+                        , split+                        , edenmodules+                        , Parallel-Arrows-Definition == 0.1.1.0+                        , Parallel-Arrows-BaseSpec == 0.1.1.0+                        , Parallel-Arrows-Eden++library+  hs-source-dirs:+      src/main+  ghc-options: -Wall+  build-depends:+      base >= 4.7 && < 5.0+    , deepseq+    , parallel+    , split+    , edenmodules+    , Parallel-Arrows-Definition == 0.1.1.0+  exposed-modules:+      Parrows.Eden+      Parrows.Eden.Simple+  default-language: Haskell2010
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ src/main/Parrows/Eden.hs view
@@ -0,0 +1,77 @@+{-+The MIT License (MIT)++Copyright (c) 2016 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 AllowAmbiguousTypes    #-}+{-# LANGUAGE FlexibleContexts       #-}+{-# LANGUAGE FlexibleInstances      #-}+{-# LANGUAGE MultiParamTypeClasses  #-}+{-# LANGUAGE UndecidableInstances   #-}+module Parrows.Eden(+  Conf(..),+  RemoteData(..),+  defaultConf,+  put',+  get',+  module Parrows.Definition,+  module Parrows.Future+) where++import           Parrows.Definition+import           Parrows.Future hiding (put', get')+import           Parrows.Util++import           Control.Arrow++import           Control.Parallel.Eden++data RemoteData a = RD { rd :: RD a }+instance NFData (RemoteData a) where+    rnf = rnf . rd+instance Trans (RemoteData a)++data Conf = Nil++defaultConf :: Conf+defaultConf = Nil++put' :: (Arrow arr, Trans a) => arr a (RemoteData a)+put' = arr (\a -> RD { rd = release a })++get' :: (Arrow arr, Trans a) => arr (RemoteData a) a+get' = arr rd >>> arr fetch++instance (Trans a) => Future RemoteData a Conf where+    put _ = put'+    get _ = get'++instance (ArrowChoice arr, ArrowParallel arr a b Conf) => ArrowLoopParallel arr a b Conf where+    loopParEvalN = parEvalN+    postLoopParEvalN _ = evalN++instance (Trans a, Trans b) => ArrowParallel (->) a b Conf where+    parEvalN _ = spawnF++instance (ArrowParallel (->) a (m b) Conf, Monad m, Trans a, Trans b, Trans (m b)) => ArrowParallel (Kleisli m) a b Conf where+    parEvalN conf fs = arr (parEvalN conf (map (\(Kleisli f) -> f) fs)) >>>+                       Kleisli sequence
+ src/main/Parrows/Eden/Simple.hs view
@@ -0,0 +1,44 @@+{-+The MIT License (MIT)++Copyright (c) 2016 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.Eden.Simple where++import Parrows.Eden+import Control.Arrow+import Control.Parallel.Eden (Trans)++instance (Trans b, ArrowChoice arr, ArrowParallel arr a b Conf) => ArrowParallel arr a b () where+    parEvalN _ fs = parEvalN defaultConf fs++instance (Trans b, ArrowChoice arr, ArrowParallel arr a b (), ArrowLoopParallel arr a b Conf) => ArrowLoopParallel arr a b () where+    loopParEvalN _ fs = loopParEvalN defaultConf fs+    postLoopParEvalN _  fs = postLoopParEvalN defaultConf fs++instance (Trans a) => Future RemoteData a () where+    put _ = put'+    get _ = get'
+ src/test/Spec.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}