Hello,
I am trying to adapt streaming version of `zstandard
<https://hackage.haskell.org/package/zstd-0.1.0.0/docs/Codec-Compression-Zstd-Streaming.html>`
using `Streaming` library. There is already a version
<https://github.com/michaelt/streaming-zstd/blob/master/Streaming/Zstd.hs>
that exists using `ByteString m r`. I can't figure out how to implement a
function like below, and will appreciate help:
stream :: MonadIO m => S.Stream (S.Of B.ByteString) m r -> Result -> S.
Stream (S.Of B.ByteString) m r
Here is the original code from `streaming-zstd`:
stream :: MonadIO m => ByteString m r -> Result -> ByteString m r
stream (Go m) res = lift m >>= flip stream res
stream bs (Error who what) = error (who ++ ": " ++ what)
stream bs (Produce bytes res') = Chunk bytes (liftIO res' >>= stream bs)
stream (Chunk c cs) (Consume f) = liftIO (f c) >>= stream cs
stream (Empty r) (Consume f) = liftIO (f mempty) >>= stream (Empty r)
stream (Empty r) (Done o) = Chunk o (Empty r)
stream input state = error $ "unpossible! bytes of input left in stream
state "
++ show state
--
You received this message because you are subscribed to the Google Groups
"Haskell Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].