B.lines returns "streaming lines" that don't need to be wholly in memory at any given time.
After B.lines, I would try to split the groups using Streaming.splitsAt, and then consume the first part of the bisected stream of lines using a combination of Streaming.mapsM_ and Data.ByteString.Streaming.effects. On Wednesday, October 4, 2017 at 9:42:28 PM UTC+2, William Casarin wrote: > > I'm playing with streaming again, I'm trying to do something simple. I > just want to drop a few lines from the start of a file. This is what I got > so far: > > process :: MonadResource m => FilePath -> Stream (S.Of Lazy.ByteString) m () > process path = > B.readFile path > & B.lines > & S.mapped B.toLazy > & S.drop 3 > > So at this point I just want to unlines again to go from > > Stream (S.Of Lazy.ByteString) m () > > -- to > > Stream (ByteString m) m r > > -- So that I can apply unlines again to get > > ByteString m r > > Any ideas on how I could go about this? I can't seem to find any functions > that help me out here > > Thanks! > -- 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].
