BȦ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None %&9;<=BOT4A space-efficient representation of a succession of 0 vectors, supporting many efficient operations. An effectful 8 contains 8-bit bytes, or by using the operations from Data.ByteString.Streaming.Char87 it can be interpreted as containing 8-bit characters.Smart constructor for ."Yield-style smart constructor for .Reconceive an effect that results in an effectful bytestring as an effectful bytestring. Compare Streaming.mwrap. The closes equivalent of 2Streaming.wrap :: f (Stream f m r) -> Stream f m r is here  consChunk. mwrap+ is the smart constructor for the internal Go constructor.CConstruct a succession of chunks from its Church encoding (compare GHC.Exts.build) Resolve a succession of chunks into its Church encoding; this is not a safe operation; it is equivalent to exposing the constructors VThe chunk size used for I/O. Currently set to 32k, less the memory management overhead TThe recommended chunk size. Currently set to 4k, less the memory management overhead EThe memory management overhead. Currently this is tuned for GHC only. vPacking and unpacking from lists packBytes' :: Monad m => [Word8] -> ByteString m () packBytes' cs0 = packChunks 32 cs0 where packChunks n cs = case S.packUptoLenBytes n cs of (bs, []) -> Chunk bs (Empty ()) (bs, cs') -> Chunk bs (packChunks (min (n * 2) BI.smallChunkSize) cs') -- packUptoLenBytes :: Int -> [Word8] -> (ByteString, [Word8]) packUptoLenBytes len xs0 = unsafeDupablePerformIO (createUptoN' len $ p -> go p len xs0) where go !_ !n [] = return (len-n, []) go !_ !0 xs = return (len, xs) go !p !n (x:xs) = poke p x >> go (p  1) (n-1) xs createUptoN' :: Int -> (Ptr Word8 -> IO (Int, a)) -> IO (S.ByteString, a) createUptoN' l f = do fp <- S.mallocByteString l (l', res)  -withForeignPtr fp $ p -C f p assert (l' <= l) $ return (S.PS fp 0 l', res) {-INLINABLE packBytes' -}HConsume the chunks of an effectful ByteString with a natural right fold. chunkFold is preferable to  foldlChunks/ since it is an appropriate argument for Control.Foldl.purelyT which permits many folds and sinks to be run simulaneously on one bytestream. chunkFoldM is preferable to  foldlChunksM/ since it is an appropriate argument for Control.Foldl.impurelyS which permits many folds and sinks to be run simulaneously on one bytestream.PConsume the chunks of an effectful ByteString with a natural right monadic fold.+Stream chunks from something that contains IO (Maybe ByteString) until it returns Nothing. reread is of particular use rendering  io-streams7 input streams as byte streams in the present sense Q.reread Streams.read :: InputStream S.ByteString -> Q.ByteString IO () Q.reread (liftIO . Streams.read) :: MonadIO m => InputStream S.ByteString -> Q.ByteString m ()The other direction here is WStreams.unfoldM Q.unconsChunk :: Q.ByteString IO r -> IO (InputStream S.ByteString) VMake the information in a bytestring available to more than one eliminating fold, e.g.3Q.count 'l' $ Q.count 'o' $ Q.copy $ "hello\nworld"3 :> (2 :> ())EQ.length $ Q.count 'l' $ Q.count 'o' $ Q.copy $ Q.copy "hello\nworld"11 :> (3 :> (2 :> ()))^runResourceT $ Q.writeFile "hello2.txt" $ Q.writeFile "hello1.txt" $ Q.copy $ "hello\nworld\n":! cat hello2.txthelloworld:! cat hello1.txthelloworldSThis sort of manipulation could as well be acheived by combining folds - using  Control.Foldl for example. But any sort of manipulation can be involved in the fold. Here are a couple of trivial complications involving splitting by lines:?let doubleLines = Q.unlines . maps (<* Q.chunk "\n" ) . Q.lines<let emphasize = Q.unlines . maps (<* Q.chunk "!" ) . Q.linesvrunResourceT $ Q.writeFile "hello2.txt" $ emphasize $ Q.writeFile "hello1.txt" $ doubleLines $ Q.copy $ "hello\nworld":! cat hello2.txthello!world!:! cat hello1.txthelloworld#As with the parallel operations in Streaming.Prelude , we have ;Q.effects . Q.copy = id hoist Q.effects . Q.copy = idThe duplication does not by itself involve the copying of bytestring chunks; it just makes two references to each chunk as it arises. This does, however double the number of constructors associated with each chunk.1  !"#$%&'()*+,-!  !     ,  !"#$%&'()*+,-h(c) Don Stewart 2006 (c) Duncan Coutts 2006-2011 (c) Michael Thompson 2015 BSD-style#what_is_it_to_do_anything@yahoo.com experimentalportableNone%&OTH.O(n)& Concatenate a stream of byte streams./WGiven a byte stream on a transformed monad, make it possible to 'run' transformer.0MPerform the effects contained in an effectful bytestring, ignoring the bytes.1Perform the effects contained in the second in an effectful pair of bytestrings, ignoring the bytes. It would typically be used at the type 0 ByteString m (ByteString m r) -> ByteString m r2O(1) The empty  -- i.e.  return () Note that ByteString m w0 is generally a monoid for monoidal values of w, like ()3O(1) Yield a  as a minimal 4O(n)( Convert a monadic stream of individual s into a packed byte stream.5O(n)A Converts a packed byte stream into a stream of individual bytes.6O(c)/ Convert a monadic stream of individual strict  chunks into a byte stream.7O(c) Convert a byte stream into a stream of individual strict bytestrings. This of course exposes the internal chunk structure.8O(1) yield a strict  chunk. 9O(n), Convert a byte stream into a single strict .Note that this is an  expensive operation that forces the whole monadic ByteString into memory and then copies all the data. If possible, try to avoid converting back and forth between streaming and strict bytestrings.:O(n)4 Convert a monadic byte stream into a single strict X, retaining the return value of the original pair. This operation is for use with . Xmapped R.toStrict :: Monad m => Stream (ByteString m) m r -> Stream (Of ByteString) m r FIt is subject to all the objections one makes to Data.ByteString.Lazy :$; all of these are devastating. ;O(c)a Transmute a pseudo-pure lazy bytestring to its representation as a monadic stream of chunks.Q.putStrLn $ Q.fromLazy "hi"hiQ.fromLazy "hi"OChunk "hi" (Empty (())) -- note: a 'show' instance works in the identity monad<Q.fromLazy $ BL.fromChunks ["here", "are", "some", "chunks"]GChunk "here" (Chunk "are" (Chunk "some" (Chunk "chunks" (Empty (())))))<O(n)5 Convert an effectful byte stream into a single lazy 1 with the same internal chunk structure. See toLazyZ which preserve connectedness by keeping the return value of the effectful bytestring.=O(n)5 Convert an effectful byte stream into a single lazy V with the same internal chunk structure, retaining the original return value. 1This is the canonical way of breaking streaming (toStrict and the like are far more demonic). Essentially one is dividing the interleaved layers of effects and bytes into one immense layer of effects, followed by the memory of the succession of bytes. (Because one preserves the return value, toLazy is a suitable argument for  P S.mapped Q.toLazy :: Stream (ByteString m) m r -> Stream (Of L.ByteString) m rQ.toLazy "hello" "hello" :> ()HS.toListM $ traverses Q.toLazy $ Q.lines "one\ntwo\nthree\nfour\nfive\n"9["one","two","three","four","five",""] -- [L.ByteString]>Test whether a ByteString is empty, collecting its return value; -- to reach the return value, this operation must check the whole length of the string.%Q.null "one\ntwo\three\nfour\nfive\n" False :> () Q.null "" True :> ()4S.print $ mapped R.null $ Q.lines "yours,\nMeredith"FalseFalse?O(1)] Test whether an ByteString is empty. The value is of course in the monad of the effects. %Q.null "one\ntwo\three\nfour\nfive\n"FalseQ.null $ Q.take 0 Q.stdinTrue:t Q.null $ Q.take 0 Q.stdin0Q.null $ Q.take 0 Q.stdin :: MonadIO m => m BoolA6Remove empty ByteStrings from a stream of bytestrings.BO1q Distinguish empty from non-empty lines, while maintaining streaming; the empty ByteStrings are on the rightDnulls :: ByteString m r -> m (Sum (ByteString m) (ByteString m) r);There are many ways to remove null bytestrings from a Stream (ByteString m) m r (besides using denull). If we pass next toAmapped nulls bs :: Stream (Sum (ByteString m) (ByteString m)) m rthen can then apply Streaming.separate to getOseparate (mapped nulls bs) :: Stream (ByteString m) (Stream (ByteString m) m) rOThe inner monad is now made of the empty bytestrings; we act on this with hoist , considering that :t Q.effects . Q.concatQ.effects . Q.concat2 :: Monad m => Stream (Q.ByteString m) m r -> m rwe have 8hoist (Q.effects . Q.concat) . separate . mapped Q.nullsK :: Monad n => Stream (Q.ByteString n) n b -> Stream (Q.ByteString n) n bDO(n/c) D+ returns the length of a byte stream as an E together with the return value. This makes various maps possible'Q.length "one\ntwo\three\nfour\nfive\n"23 :> ()MS.print $ S.take 3 $ mapped Q.length $ Q.lines "one\ntwo\three\nfour\nfive\n"384EO(1) E! is analogous to '(:)' for lists.FO(1) Unlike E, 'cons\'' is strict in the ByteString that we are consing onto. More precisely, it forces the head and the first chunk. It does this because, for space efficiency, it may coalesce the new byte onto the first 'chunk' rather than starting a new 'chunk'.CSo that means you can't use a lazy recursive contruction like this: let xs = cons\' c xs in xsYou can however use E , as well as W and X", to build infinite byte streams.GO(n/c) Append a byte to the end of a HO(1) Extract the first element of a , which must be non-empty.IO(c) Extract the first element of a , which must be non-empty.JO(1) Extract the head and tail of a , or  if it is emptyKO(1) Extract the head and tail of a a, or its return value if it is empty. This is the 'natural' uncons for an effectful byte stream.NO(n/c) Extract the last element of a &, which must be finite and non-empty.PO(n/c) Append twoQO(n) Q f xs( is the ByteString obtained by applying f to each element of xs.SS, applied to a binary operator, a starting value (typically the right-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from right to left. foldr cons = idTT, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. We use the style of the foldl libarary for left foldsUUs keeps the return value of the left-folded bytestring. Useful for simultaneous folds over a segmented bytestreamVV f x? returns an infinite ByteString of repeated applications -- of f to x: %iterate f x == [x, f x, f (f x), ...](R.stdout $ R.take 50 $ R.iterate succ 392()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY,Q.putStrLn $ Q.take 50 $ Q.iterate succ '\''2()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYWW x! is an infinite ByteString, with x! the value of every element."R.stdout $ R.take 50 $ R.repeat 602<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<%Q.putStrLn $ Q.take 50 $ Q.repeat 'z'2zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzXX ties a finite ByteString into a circular one, or equivalently, the infinite repetition of the original ByteString. For an empty bytestring (like  return 17*) it of course makes an unproductive loop &Q.putStrLn $ Q.take 7 $ Q.cycle "y\n"yyyyYO(n) The Z% function is analogous to the Stream unfoldr. ZU builds a ByteString from a seed value. The function takes the element and returns 4 if it is done producing the ByteString or returns  (a,b), in which case, a( is a prepending to the ByteString and b2 is used as the next element in a recursive call.Zunfold is like Z) but stops when the co-algebra returns (; the result is the return value of the ByteString m r unfoldr uncons = id[O(n/c) [ n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n > D xs.JNote that in the streaming context this drops the final return value; ]> preserves this information, and is sometimes to be preferred.8Q.putStrLn $ Q.take 8 $ "Is there a God?" >> return TrueIs there-Q.putStrLn $ "Is there a God?" >> return TrueIs there a God?TrueCrest <- Q.putStrLn $ Q.splitAt 8 $ "Is there a God?" >> return TrueIs thereQ.effects restTrue\O(n/c) \ n xs returns the suffix of xs after the first n elements, or [] if n > D xs.!Q.putStrLn $ Q.drop 6 "Wisconsin"sin"Q.putStrLn $ Q.drop 16 "Wisconsin"]O(n/c) ] n xs is equivalent to ([ n xs, \ n xs).\rest <- Q.putStrLn $ Q.splitAt 3 "therapist is a danger to good hyphenation, as Knuth notes"theQ.putStrLn $ Q.splitAt 19 restrapist is a danger ^^, applied to a predicate p and a ByteString xs2, returns the longest prefix (possibly empty) of xs of elements that satisfy p.__ p xs$ returns the suffix remaining after ^ p xs.`` p is equivalent to a ( . p).aa p xs? breaks the ByteString into two segments. It is equivalent to (^ p xs, _ p xs)bO(n) Splits a  into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg. TsplitWith (=='a') "aabbaca" == ["","","bb","c",""] splitWith (=='a') [] == []cO(n) Break a K into pieces separated by the byte argument, consuming the delimiter. I.e. ~split '\n' "a\nb\nd\ne" == ["a","b","d","e"] split 'a' "aXaXaXa" == ["","X","X","X",""] split 'x' "x" == ["",""]and 9intercalate [c] . split c == id split == splitWith . (==)tAs for all splitting functions in this library, this function does not copy the substrings, it just constructs new  ByteStrings" that are slices of the original.dThe d function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example, :group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]It is a special case of eA, which allows the programmer to supply their own equality test.eThe e& function is a generalized version of d.fO(n) The f function takes a  and a list of es and concatenates the list after interspersing the first argument between each element of the list.gHcount returns the number of times its argument appears in the ByteString count = length . elemIndicesiO(n) iy, applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate.jRead entire handle contents lazily into a ,. Chunks are read on demand, in at most k9-sized chunks. It does not block waiting for a whole k-sized chunk, so if less than kS bytes are available then they will be returned immediately as a smaller chunk.The handle is closed on EOF. Note: the * should be placed in binary mode with  for j to work correctly.kRead n bytes into a , directly from the specified , in chunks of size k.lhGetNonBlockingN is similar to j, except that it will never block waiting for data to become available, instead it returns only whatever data is available. Chunks are read on demand, in k-sized chunks.mRead entire handle contents lazily into a >. Chunks are read on demand, using the default chunk size..Once EOF is encountered, the Handle is closed. Note: the * should be placed in binary mode with  for m to work correctly.nPipes-style nomenclature for moPipes-style nomenclature for upRead n bytes into a , directly from the specified .qhGetNonBlocking is similar to p, except that it will never block waiting for data to become available, instead it returns only whatever data is available. If there is no data available to be read, q returns 2.Note: on Windows and with Haskell implementation other than GHC, this function does not work correctly; it behaves identically to p.rWrite a  to a file. Use * to ensure that the handle is closed. :set -XOverloadedStringsGrunResourceT $ Q.writeFile "hello.txt" "Hello world.\nGoodbye world.\n":! cat "hello.txt" Hello world.Goodbye world.@runResourceT $ Q.writeFile "hello2.txt" $ Q.readFile "hello.txt":! cat hello2.txt Hello world.Goodbye world.s#Read an entire file into a chunked  IO ()W. The handle will be held open until EOF is encountered. The block governed by 5 will end with the closing of any handles opened.:! cat hello.txt Hello world.Goodbye world. 0runResourceT $ Q.stdout $ Q.readFile "hello.txt" Hello world.Goodbye world. t Append a  to a file. Use * to ensure that the handle is closed. GrunResourceT $ Q.writeFile "hello.txt" "Hello world.\nGoodbye world.\n"0runResourceT $ Q.stdout $ Q.readFile "hello.txt" Hello world.Goodbye world.DrunResourceT $ Q.appendFile "hello.txt" "sincerely yours,\nArthur\n"1runResourceT $ Q.stdout $ Q.readFile "hello.txt" Hello world.Goodbye world.sincerely yours,Arthuru9getContents. Equivalent to hGetContents stdin. Will read lazilyv Outputs a  to the specified .wPipes nomenclature for vxPipes-style nomenclature for putStryA synonym for hPut, for compatibility<hPutStr :: Handle -> ByteString IO r -> IO r hPutStr = hPut\- | Write a ByteString to stdout putStr :: ByteString IO r -> IO r putStr = hPut IO.stdout/The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. %interact morph = stdout (morph stdin)o is a variant of findIndex, that returns the length of the string if no element is found, rather than Nothing.|iTake a builder and convert it to a genuine streaming bytestring, using a specific allocation strategy.~*A simple construction of a builder from a .5let aaa = "10000 is a number\n" :: Q.ByteString IO ()'hPutBuilder IO.stdout $ toBuilder aaa10000 is a numberV./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~] ./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]2345;=<678:90 1/QfREFGPiJKA`\_dea]b[^c.|{~}WVXYZSTUIHONDC>?B@hguoxysrtnwpmjkqlvzLMV./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NoneOTO(n)C Convert a stream of separate characters into a packed byte stream.O(1) Cons a  onto a byte stream.O(1) Yield a  as a minimal O(1) Unlike , 'cons\'' is strict in the ByteString that we are consing onto. More precisely, it forces the head and the first chunk. It does this because, for space efficiency, it may coalesce the new byte onto the first 'chunk' rather than starting a new 'chunk'.CSo that means you can't use a lazy recursive contruction like this: let xs = cons\' c xs in xsYou can however use  , as well as  and X&, to build infinite lazy ByteStrings.O(n/c) Append a byte to the end of a O(1)D Extract the first element of a ByteString, which must be non-empty.O(1)B Extract the first element of a ByteString, which may be non-emptyO(n/c)O Extract the last element of a ByteString, which must be finite and non-empty.O(1)N Extract the head and tail of a ByteString, returning Nothing if it is empty.O(n)  f xs( is the ByteString obtained by applying f to each element of xs. f x= returns an infinite ByteString of repeated applications of f to x: x! is an infinite ByteString, with x the value of every element.Xt ties a finite ByteString into a circular one, or equivalently, the infinite repetition of the original ByteString.| O(n) The 1 function is analogous to the Stream 'unfoldr'. U builds a ByteString from a seed value. The function takes the element and returns 4 if it is done producing the ByteString or returns  (a,b), in which case, a( is a prepending to the ByteString and b2 is used as the next element in a recursive call., applied to a predicate p and a ByteString xs2, returns the longest prefix (possibly empty) of xs of elements that satisfy p. p xs$ returns the suffix remaining after  p xs. p is equivalent to  ( . p). p xs? breaks the ByteString into two segments. It is equivalent to ( p xs,  p xs)O(n) Break a O into pieces separated by the byte argument, consuming the delimiter. I.e. ~split '\n' "a\nb\nd\ne" == ["a","b","d","e"] split 'a' "aXaXaXa" == ["","X","X","X",""] split 'x' "x" == ["",""]and 9intercalate [c] . split c == id split == splitWith . (==)sAs for all splitting functions in this library, this function does not copy the substrings, it just constructs new  ByteStrings! that are slices of the original.0Q.stdout $ Q.unlines $ Q.split 'n' "banana peel"baaa peelO(n) y, applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. turns a ByteString into a connected stream of ByteStrings at divide at newline characters. The resulting strings do not contain newlines. This is the genuinely streaming L which only breaks chunks, and thus never increases the use of memory. Because fs are usually read in binary mode, with no line ending conversion, this function recognizes both \n and \r\n3 endings (regardless of the current platform).The . function restores line breaks between layers.+Note that this is not a perfect inverse of : . Y can produce more strings than there were if some of the "lines" had embedded newlines. .  will replace \r\n with \n. breaks a byte stream up into a succession of byte streams corresponding to words, breaking Chars representing white space. This is the genuinely streaming p. A function that returns individual strict bytestrings would concatenate even infinitely long words like  cycle "y" in memory. It is best for the user who has reflected on her materials to write `mapped toStrict . words` or the like, if strict bytestrings are needed.The  function is analogous to the  function, on words. turns a ByteString into a connected stream of ByteStrings at divide after a fixed number of newline characters. Unlike most of the string splitting functions in this library, this function preserves newlines characters. Like &, this function properly handles both \n and \r\nF endings regardless of the current platform. It does not support \r or \n\r line endings.Vlet planets = ["Mercury","Venus","Earth","Mars","Saturn","Jupiter","Neptune","Uranus"]`S.mapsM_ (\x -> putStrLn "Chunk" >> Q.putStrLn x) $ Q.lineSplit 3 $ Q.string $ L.unlines planetsChunkMercuryVenusEarth(Chunk Mars Saturn JupiterChunk Neptune UranustSince all characters originally present in the stream are preserved, this function satisfies the following law: $,o n bs. concat (lineSplit n bs) "E bsMThis will read positive or negative Ints that require 18 or fewer characters.(number of lines per groupstream of bytesf  ./0126789:;<=>?@ABCDLMPX[\]dfjklmnopqrstuvwxy{|}~f26;87=<:90 1fP>?@B\d][A.{|~}XDCuoxysrtnwpmjkqlvLM/ (      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~=<M;NOPQVWmRYZ]\^_abfghijkqop1streaming-bytestring-0.1.5-E1pQtrkT5Cp3N4jWrrnqvs"Data.ByteString.Streaming.InternalData.ByteString.StreamingData.ByteString.Streaming.Char8 System.IOhSetBinaryModeControl.Monad.Trans.ResourceT runResourceT ByteStringEmptyChunkGobracketByteString consChunkchunkmwrap materialize dematerializedefaultChunkSizesmallChunkSize chunkOverhead packBytes packChars unpackBytes unsafeLast unsafeInitinlinePerformIO foldrChunks foldlChunkschunkMap chunkMapM chunkMapM_ chunkFold chunkFoldM foldlChunksM foldrChunksM unfoldrNE unfoldMChunks unfoldrChunksrereadcopy$fMonadResourceByteString$fMonadCatchByteString$fMonadThrowByteString$fMonadBasebByteString$fMonoidByteString$fShowByteString$fIsStringByteString$fMFunctorTYPEByteString$fMonadTransByteString$fMonadIOByteString$fMonadByteString$fApplicativeByteString$fFunctorByteStringconcat distributeeffectsdrainedempty singletonpackunpack fromChunkstoChunks fromStrict toStrict_toStrictfromLazytoLazy_toLazynullnull_testNulldenullnullslength_lengthconscons'snochead_headunconsnextByte unconsChunk nextChunklast_lastappendmap interspersefoldrfoldfold_iteraterepeatcycleunfoldMunfoldrtakedropsplitAt takeWhile dropWhilebreakspan splitWithsplitgroupgroupBy intercalatecount_countfilter hGetContentsNhGetNhGetNonBlockingN hGetContents fromHandlestdinhGethGetNonBlocking writeFilereadFile appendFile getContentshPuttoHandlestdoutinteract zipWithStreamtoStreamingByteStringtoStreamingByteStringWithconcatBuilders toBuilderlinesunlineswordsunwords lineSplitstringnextCharputStrputStrLnreadIntbaseGHC.WordWord8GHC.PtrplusPtrSPECSPEC2(streaming-0.2.0.0-L7KUsrkkM341tk5MlQaig8Streaming.Preludemappedghc-prim GHC.TypesIntGHC.BaseNothingJust Data.EitherLeft GHC.ClassesnotGHC.IO.Handle.TypesHandle'resourcet-1.1.10-El0DiqY1hjKBOmBt94SqSrControl.Monad.Trans.ResourcefindIndexOrEnd isPrefixOfillegalBufferSizerevNonEmptyChunks revChunksCharnewline