quiver 0.0.0.2 → 0.0.0.3
raw patch · 2 files changed
+15/−2 lines, 2 files
Files
- quiver.cabal +2/−2
- src/Control/Quiver.lhs +13/−0
quiver.cabal view
@@ -1,5 +1,5 @@ name: quiver-version: 0.0.0.2+version: 0.0.0.3 synopsis: Quiver finite stream processing library homepage: https://github.com/zadarnowski/quiver category: Control@@ -35,7 +35,7 @@ source-repository this type: git location: https://github.com/zadarnowski/quiver.git- tag: 0.0.0.2+ tag: 0.0.0.3 library hs-source-dirs: src
src/Control/Quiver.lhs view
@@ -20,6 +20,7 @@ > fetch, fetch', > emit, emit', emit_, > liftP,+> runEffect, > (>>->), (>->>), > ) where @@ -71,6 +72,18 @@ > liftP :: Functor f => f r -> P a' a b' b f r > liftP = enclose . fmap deliver++> -- | Evaluates an /effect/, i.e., a processor that is both detached+> -- and depleted and hence neither consumes nor produces any input,+> -- returning its delivered value. The base functor must be a monad.++> runEffect :: Monad f => Effect f r -> f r+> runEffect p = loop p+> where+> loop (Consume _ _ q) = loop q+> loop (Produce _ _ q) = loop q+> loop (Enclose f) = f >>= loop+> loop (Deliver r) = return r > -- | The @>>->@ represents a push-based composition of stream processor. > -- @p1 >>-> p2@ represents a stream processor that forwards the output