map-reduce-folds 0.1.0.5 → 0.1.0.7
raw patch · 3 files changed
+28/−20 lines, 3 filesdep ~basedep ~profunctorsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, profunctors
API changes (from Hackage documentation)
- Control.MapReduce.Engines.Vector: toList :: () => Vector a -> [a]
+ Control.MapReduce.Engines.Vector: toList :: Vector a -> [a]
Files
- ChangeLog.md +6/−0
- map-reduce-folds.cabal +17/−17
- src/Control/MapReduce/Engines/Streamly.hs +5/−3
ChangeLog.md view
@@ -1,3 +1,9 @@+* version 0.1.0.7+* Bumped some upper bounds in prep for ghc-9++* version 0.1.0.6+* Using ```Data.List.NonEmpty``` to clarify/fix use of partial ```head``` in Streamly Discriminated GroupBy.+ * version 0.1.0.5 * Bumped base upper bound * Checked compilation with ghc-8.10.2
map-reduce-folds.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2- + name: map-reduce-folds-version: 0.1.0.5+version: 0.1.0.7 build-type: Simple synopsis: foldl wrappers for map-reduce description: map-reduce-folds simplifies the building of folds to do map-reduce style computations on collections. It breaks the map/reduce into an unpacking step where items may be filtered, transformed or "melted" (made into several new items), an assign step where the unpacked items are assigned keys, a grouping step where the assigned items are grouped by key and then a reduce step which is applied to each grouped subset. Tools are provided to simplify building the individual steps and then "engines" are provided for combining them into efficient folds returning an assortment of containers. The various pieces are replicated for effectful (monadic) steps producing effectful (monadic) folds.@@ -14,7 +14,7 @@ category: Control extra-source-files: ChangeLog.md tested-with: GHC ==8.6.4 || ==8.6.2 || ==8.8.3 || ==8.10.2- + flag dump-core description: Dump HTML for the core generated by GHC during compilation default: False@@ -23,20 +23,20 @@ source-repository head Type: git Location: https://github.com/adamConnerSax/map-reduce-folds- + common deps- build-depends: base >= 4.12.0 && < 4.15,+ build-depends: base >= 4.12.0 && < 4.17, containers >= 0.5.0 && < 0.7, foldl >= 1.4.5 && < 1.5,- profunctors >= 5.3 && < 5.6,+ profunctors >= 5.3 && < 5.7, text >= 1.2.3 && < 1.3, unordered-containers >= 0.2.10 && < 0.3- + library import: deps if flag(dump-core) build-depends: dump-core- ghc-options: -fforce-recomp -fplugin=DumpCore -fplugin-opt DumpCore:core-html + ghc-options: -fforce-recomp -fplugin=DumpCore -fplugin-opt DumpCore:core-html ghc-options: -Wall -O2 -fspec-constr-recursive=16 -fmax-worker-args=16 -fspecialise-aggressively -funbox-strict-fields -fexpose-all-unfoldings exposed-modules: Control.MapReduce , Control.MapReduce.Core@@ -67,24 +67,24 @@ main-is: TestAll.hs other-modules: Test1 hs-source-dirs: test- ghc-options: + ghc-options: build-depends: base , hedgehog >= 0.6.0 && < 1.1- , map-reduce-folds + , map-reduce-folds , containers , foldl- + default-language: Haskell2010- + benchmark bench-map-reduce import: deps if flag(dump-core) build-depends: dump-core- ghc-options: -fforce-recomp -fplugin=DumpCore -fplugin-opt DumpCore:core-html + ghc-options: -fforce-recomp -fplugin=DumpCore -fplugin-opt DumpCore:core-html type: exitcode-stdio-1.0 hs-source-dirs: bench- other-modules: + other-modules: ghc-options: -O2 -fspec-constr-recursive=16 -fmax-worker-args=16 -fspecialise-aggressively -funbox-strict-fields -fexpose-all-unfoldings -fforce-recomp -- -threaded "-with-rtsopts=-N" main-is: MapReduce.hs@@ -97,7 +97,7 @@ test-suite listStats import: deps- type: exitcode-stdio-1.0 + type: exitcode-stdio-1.0 main-is: ListStats.hs hs-source-dirs: examples ghc-options: -Wall -O2 -fspec-constr-recursive=16 -fmax-worker-args=16@@ -106,9 +106,9 @@ test-suite readmeExample import: deps- type: exitcode-stdio-1.0 + type: exitcode-stdio-1.0 main-is: readmeExample.hs hs-source-dirs: examples ghc-options: -Wall -O2 -fspec-constr-recursive=16 -fmax-worker-args=16 build-depends: map-reduce-folds -any- default-language: Haskell2010 + default-language: Haskell2010
src/Control/MapReduce/Engines/Streamly.hs view
@@ -80,6 +80,8 @@ import qualified Data.HashMap.Strict as HMS import qualified Data.HashTable.Class as HT import qualified Data.HashTable.ST.Cuckoo as HTC+import qualified Data.List.NonEmpty as LNE+import qualified Data.Maybe as Maybe import qualified Data.Map.Strict as MS import qualified Data.Sequence as Seq import qualified Streamly.Prelude as S@@ -245,7 +247,7 @@ -> S.SerialT m (k, Seq.Seq c) groupByDiscriminatedKey s = do lkc <- S.yieldM (S.toList s)- let g :: [(k, c)] -> (k, Seq.Seq c)- g x = let k = fst (head x) in (k, F.fold $ fmap (Seq.singleton . snd) x)- S.fromFoldable $ fmap g $ DG.groupWith fst lkc+ let g :: LNE.NonEmpty (k, c) -> (k, Seq.Seq c)+ g x = let k = fst (LNE.head x) in (k, F.fold $ fmap (Seq.singleton . snd) x)+ S.fromFoldable $ Maybe.catMaybes . fmap (fmap g . LNE.nonEmpty) $ DG.groupWith fst lkc {-# INLINABLE groupByDiscriminatedKey #-}