Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Streaming/Conduit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import Control.Monad (join, void)
import Control.Monad.Trans.Class (lift)
import Data.ByteString (ByteString)
import qualified Data.ByteString.Streaming as B
import Data.Conduit (Conduit, ConduitM, Producer, Source, Consumer,
import Data.Conduit (Conduit, ConduitM, ConduitT, Producer, Source, Consumer,
await, runConduit, transPipe, (.|))
import qualified Data.Conduit.List as CL
import Streaming (Of, Stream)
Expand All @@ -63,15 +63,15 @@ fromStreamSource = void . fromStream

-- | A more specialised variant of 'fromStream' that is subject to
-- fusion.
fromStreamProducer :: (Monad m) => Stream (Of a) m r -> Producer m a
fromStreamProducer :: (Monad m) => Stream (Of a) m r -> ConduitT i a m ()
fromStreamProducer = CL.unfoldM S.uncons . void

-- | Convert a streaming 'B.ByteString' into a 'Source'; subject to fusion.
fromBStream :: (Monad m) => B.ByteString m r -> ConduitM i ByteString m r
fromBStream = CL.unfoldEitherM B.nextChunk

-- | A more specialised variant of 'fromBStream'.
fromBStreamProducer :: (Monad m) => B.ByteString m r -> Producer m ByteString
fromBStreamProducer :: (Monad m) => B.ByteString m r -> ConduitT i ByteString m ()
fromBStreamProducer = CL.unfoldEitherM B.unconsChunk . void

-- | Convert a 'Producer' to a 'Stream'. Subject to fusion.
Expand Down
6 changes: 6 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolver: lts-24.3
packages:
- "."
extra-deps: []
flags: {}
extra-package-dbs: []
12 changes: 12 additions & 0 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages: []
snapshots:
- completed:
sha256: aa97dce5253937e4aa56100a0a9dc1f79a554cf543ad7cfab0afe6ed42de2f31
size: 724941
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/3.yaml
original: lts-24.3
2 changes: 1 addition & 1 deletion streaming-conduit.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test-suite conversions
build-depends: streaming-conduit
, base
, conduit
, hspec == 2.4.*
, hspec
, streaming
hs-source-dirs: test
default-language: Haskell2010