quiver 0.0.0.11 → 0.0.0.12
raw patch · 2 files changed
+21/−4 lines, 2 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Control.Quiver.SP: sptraverse :: Monad m => (a -> m b) -> SP a b m e
+ Control.Quiver.SP: sptraverse_ :: Monad m => (a -> m ()) -> SP a b m e
Files
- quiver.cabal +4/−4
- src/Control/Quiver/SP.lhs +17/−0
quiver.cabal view
@@ -1,5 +1,5 @@ name: quiver-version: 0.0.0.11+version: 0.0.0.12 synopsis: Quiver finite stream processing library homepage: https://github.com/zadarnowski/quiver category: Control@@ -15,7 +15,7 @@ /Quiver/ is a powerful stream processing library for combinatorial and monadic representation of computations over both inductive and coinductive data streams.-+ . It is similar to Gabriel Gonzalez's /pipes/ and Michael Snoyman's /conduit/, but generalises both with support for functor-based computations and@@ -35,12 +35,12 @@ source-repository this type: git location: https://github.com/zadarnowski/quiver.git- tag: 0.0.0.11+ tag: 0.0.0.12 library hs-source-dirs: src default-language: Haskell2010- ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-missing-signatures+ ghc-options: -O2 -Wall -fno-warn-unused-do-bind -fno-warn-missing-signatures exposed-modules: Control.Quiver
src/Control/Quiver/SP.lhs view
@@ -22,6 +22,7 @@ > spfetch, spemit, (>:>), (>>!), > sppure, spid, spconcat, > spfold, spfold', spfoldl, spfoldl', spfoldr, spfoldr',+> sptraverse, sptraverse_, > ) where > import Control.Quiver@@ -169,3 +170,19 @@ > where > cloop r = r `seq` consume () (cloop . flip f r) (deliver r) +> -- | A processor that applies a monadic function to every input+> -- element and emits the resulting value.++> sptraverse :: Monad m => (a -> m b) -> SP a b m e+> sptraverse k = loop+> where+> loop = consume () loop' (deliver SPComplete)+> loop' x = qlift (k x) >>= (>:> loop)++> -- | A processor that consumes every input elemnet using a monadic function.++> sptraverse_ :: Monad m => (a -> m ()) -> SP a b m e+> sptraverse_ k = loop+> where+> loop = consume () loop' (deliver SPComplete)+> loop' x = qlift (k x) >> loop