Copyright | (c) Adam Conner-Sax 2019 |
---|---|
License | BSD-3-Clause |
Maintainer | adam_conner_sax@yahoo.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
map-reduce engine (fold builder) using Streaming.Streams
as its intermediate type. Because Streaming.Stream
does not end with the
type of data data in the Stream
, we wrap this type in StreamResult
for the purposes of the output type of the fold.
Synopsis
- newtype StreamResult m d = StreamResult {}
- streamingEngine :: (Foldable g, Functor g) => (forall z r. Stream (Of (k, z)) Identity r -> Stream (Of (k, g z)) Identity r) -> MapReduceFold y k c (StreamResult Identity) x d
- streamingEngineM :: (Monad m, Traversable g) => (forall z r. Stream (Of (k, z)) m r -> Stream (Of (k, g z)) m r) -> MapReduceFoldM m y k c (StreamResult m) x d
- resultToList :: Monad m => StreamResult m d -> m [d]
- concatStream :: (Monad m, Monoid a) => StreamResult m a -> m a
- concatStreamFold :: Monoid b => Fold a (StreamResult Identity b) -> Fold a b
- concatStreamFoldM :: (Monad m, Monoid b) => FoldM m a (StreamResult m b) -> FoldM m a b
- groupByHashableKey :: forall m k c r. (Monad m, Hashable k, Eq k) => Stream (Of (k, c)) m r -> Stream (Of (k, Seq c)) m r
- groupByOrderedKey :: forall m k c r. (Monad m, Ord k) => Stream (Of (k, c)) m r -> Stream (Of (k, Seq c)) m r
Helper Types
newtype StreamResult m d Source #
Wrap Stream (Of d) m ()
in a type which has d
as its last parameter
Engines
streamingEngine :: (Foldable g, Functor g) => (forall z r. Stream (Of (k, z)) Identity r -> Stream (Of (k, g z)) Identity r) -> MapReduceFold y k c (StreamResult Identity) x d Source #
map-reduce-fold builder returning a StreamResult
streamingEngineM :: (Monad m, Traversable g) => (forall z r. Stream (Of (k, z)) m r -> Stream (Of (k, g z)) m r) -> MapReduceFoldM m y k c (StreamResult m) x d Source #
effectful map-reduce-fold builder returning a StreamResult
Result Extractors
resultToList :: Monad m => StreamResult m d -> m [d] Source #
get a []
result from a Stream
concatStream :: (Monad m, Monoid a) => StreamResult m a -> m a Source #
mappend
all elements of a StreamResult
of monoids
concatStreamFold :: Monoid b => Fold a (StreamResult Identity b) -> Fold a b Source #
apply monoidal stream-concatenation to a fold returning a stream to produce a fold returning the monoid
concatStreamFoldM :: (Monad m, Monoid b) => FoldM m a (StreamResult m b) -> FoldM m a b Source #
apply monoidal stream-concatenation to an effectful fold returning a stream to produce an effectful fold returning the monoid