Îõ³h*90ÑØ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW0.2.6.0 Safe-InferredÅstreaming-utilsThe result of a parse (Either a ([String], String)#), with the unconsumed byte stream.Ï:set -XOverloadedStrings -- the string literal below is a streaming bytestringÊ(r,rest1) <- AS.parse (A.scientific <* A.many' A.space) "12.3 4.56 78.3"print r Left 12.3=(s,rest2) <- AS.parse (A.scientific <* A.many' A.space) rest1print s Left 4.56=(t,rest3) <- AS.parse (A.scientific <* A.many' A.space) rest2print t Left 78.3Q.putStrLn rest3 streaming-utilsˆApply a parser repeatedly to a stream of bytes, streaming the parsed values, but ending when the parser fails.or the bytes run out.ÊS.print $ AS.parsed (A.scientific <* A.many' A.space) $ "12.3 4.56 78.9"12.34.5678.918.282 streaming-utilsAttoparsec parserstreaming-utils Raw input   Safe-Inferred7ÂÄØÝ "streaming-utilsAn  attoparsec7 error that happened while parsing the raw JSON string.#streaming-utilsAn aeson0 error that happened while trying to convert a   to an    instance, as reported by  .Xstreaming-utils%An error while decoding a JSON value.$streaming-utilsThis instance allows using   with  and 0 instance Error (DecodingError, Producer a m r)Consecutively parse a elements from the given Producer" using the given parser (such as  or .), skipping any leading whitespace each time.This Produceræ runs until it either runs out of input or until a decoding failure occurs, in which case it returns Y with a ! and a Producer! with any leftovers. You can use   to turn the Z return value into an  monad transformer.Like , except it accepts any [ instance, not just \ or ].%streaming-utilsÕGiven a bytestring, parse a top level json entity - returning any leftover bytes.&streaming-utilsßResolve a succession of top-level json items into a corresponding stream of Haskell values.'streaming-utils(Experimental. Parse a bytestring with a  json-streamsö parser. The function will read through the whole of a single top level json entity, streaming the valid parses as they arise. (It will thus for example parse an infinite json bytestring, though these are rare in practice ...)ýIf the parser is fitted to recognize only one thing, then zero or one item will be yielded; if it uses combinators like arrayOf–, it will stream many values as they arise. See the example at the top of this module, in which values inside a top level array are emitted as they are parsed. Aeson would accumulate the whole bytestring before declaring on the contents of the array. This of course makes sense, since attempt to parse a json array may end with a bad parse, invalidating the json as a whole. With  json-streams÷, a bad parse will also of course emerge in the end, but only after the initial good parses are streamed. This too makes sense though, but in a smaller range of contexts -- for example, where one is folding over the parsed material.*This function is closely modelled on  and  from Data.JsonStream.Parser.!"#$%&'!"#$%&' Safe-Inferred"K,streaming-utils Send an HTTP ^ and wait for an HTTP _-streaming-utils Create a `( from a content length and an effectful a.streaming-utils Create a ` from an effectful a. is more flexible than -Ã, but requires the server to support chunked transfer encoding./streaming-utilsºThis is a quick method - oleg would call it 'unprofessional' - to bring a web page in view. It sparks its own internal manager and closes itself. Thus something like this makes senseÁrunResourceT $ Q.putStrLn $ simpleHttp "http://lpaste.net/raw/12"chunk _ [] = [];chunk n xs = let h = take n xs in h : (chunk n (drop n xs))but if you try something likeÜrest <- runResourceT $ Q.putStrLn $ Q.splitAt 40 $ simpleHTTP "http://lpaste.net/raw/146532"&import Data.ByteString.Streaming.HTTP "it will just be good luck if with runResourceT $ Q.putStrLn restyou get the rest of the file:  ‚import qualified Data.ByteString.Streaming.Char8 as Q main = runResourceT $ Q.putStrLn $ simpleHTTP "http://lpaste.net/raw/146532" rather than  Ê*** Exception: : hGetBuf: illegal operation (handle is closed)ÄSince, of course, the handle was already closed by the first use of  runResourceT6. The same applies of course to the more hygienic ,- above, which permits one to extract an IO (ByteString IO r) , by using splitAt or the like. ÕThe reaction of some streaming-io libraries was simply to forbid operations like splitAtŽ. That this paternalism was not viewed as simply outrageous is a consequence of the opacity of the older iteratee-io libraries. It is obviousê that I can no more run an effectful bytestring after I have made its effects impossible by using  runResourceT (which basically means closeEverythingDown©). I might as well try to run it after tossing my machine into the flames. Similarly, it is obvious that I cannot read from a handle after I have applied hClose6; there is simply no difference between the two cases.,streaming-utilsHandler for responseÎ,0-./bcdefghijklmnopqrstuvwx_yz{|}~^€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•`–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£ ,0-./ Safe-InferredØÝn1streaming-utilsÊReceives bytes from a connected socket with a maximum chunk size. The bytestream ends if the remote peer closes its side of the connection or EOF is received. The implementation is as follows: œfromSocket sock nbytes = loop where loop = do bs <- liftIO (NSB.recv sock nbytes) if B.null bs then return () else Q.chunk bs >> loop2streaming-utilsÚConnect a stream of bytes to the remote end. The implementation is again very simple: ”toSocket sock = loop where loop bs = do e <- Q.nextChunk bs case e of Left r -> return r Right (b,rest) -> send sock b >> loop rest1streaming-utilsConnected socket.streaming-utilsØMaximum number of bytes to receive and send dowstream at once. Renzo recommends using 4096% if you don't have a special purpose.2streaming-utilsConnected socket.12   12    Safe-InferredØÝ*3streaming-utilsConstruct an ordinary pipes ¤ from a ¥ of elements3runEffect $ fromStream (S.each [1..3]) >-> P.print1234streaming-utils Construct a ¥ of elements from a pipes ¤"S.print $ toStream $ P.each [1..3]1235streaming-utilsÆLink the chunks of a producer of bytestrings into a single byte stream6streaming-utils7Successively yield the chunks hidden in a byte stream. 7streaming-utils7 splits a ¤ into two ¤ s; the outer ¤â is the longest consecutive group of elements that satisfy the predicate. Its inverse is 8streaming-utils8 splits a ¤ into two ¤ s; the outer ¤ß is the longest consecutive group of elements that fail the predicate. Its inverse is ;streaming-utils; divides a ¤ into two ¤8s after a fixed number of elements. Its inverse is <streaming-utils< splits a ¤ into two ¤‡s; the second producer begins where we meet an element that is different according to the equality predicate. Its inverse is =streaming-utilsLike <#, where the equality predicate is (¦)>streaming-utils> splits a ¤ into a ¥ of ¤%s of equal items. Its inverse is B?streaming-utils groupsBy' splits a ¤ into a ¥ of ¤7s grouped using the given relation. Its inverse is BThis differs from >è by comparing successive elements instead of comparing each element to the first member of the groupimport Pipes (yield, each)import Pipes.Prelude (toList)let rel c1 c2 = succ c1 == c2Å(toList . intercalates (yield '|') . groupsBy' rel) (each "12233345") "12|23|3|345"Å(toList . intercalates (yield '|') . groupsBy rel) (each "12233345")"122|3|3|34|5"Astreaming-utilsA splits a ¤ into a ¥ of ¤(s of a given length. Its inverse is B.4let listN n = L.purely P.folds L.list . P.chunksOf nÈrunEffect $ listN 3 P.stdinLn >-> P.take 2 >-> P.map unwords >-> P.print123"1 2 3"456"4 5 6"Âlet stylish = P.concats . P.maps (<* P.yield "-*-") . P.chunksOf 2ÑrunEffect $ stylish (P.each $ words "one two three four five six") >-> P.stdoutLn onetwo-*-threefour-*-fivesix-*-Bstreaming-utilsJoin a stream of ¤s into a single ¤Cstreaming-utils Fold each ¤ in a producer ¥ Öpurely folds :: Monad m => Fold a b -> Stream (Producer a m) m r -> Producer b m rDstreaming-utils Fold each ¤ in a ¤ stream, monadically Úimpurely foldsM :: Monad m => FoldM a b -> Stream (Producer a m) m r -> Producer b m rEstreaming-utils (takes' n) only keeps the first n ¤s of a linked ¥ of  ProducersUnlike , E- is not functor-general - it is aware that a ¤ can be drainedÈ, as functors cannot generally be. Here, then, we drain the unused ¤Õs in order to preserve the return value. This makes it a suitable argument for .Cstreaming-utils Step functionstreaming-utilsInitial accumulatorstreaming-utilsExtraction functionDstreaming-utils Step functionstreaming-utilsInitial accumulatorstreaming-utilsExtraction function3456A@>?9:BCDE78;=<3456A@>?9:BCDE78;=< Safe-Inferred0¯ Fstreaming-utils#How hard should we try to compress?Gstreaming-utils#Decompress a streaming bytestring. § is from Codec.Compression.Zlib G  :: ¨ m => a m r -> a m r Hstreaming-utilsäDecompress a zipped byte stream, returning any leftover input that follows the compressed material.Istreaming-utils;Keep decompressing a compressed bytestream until exhausted.Jstreaming-utilsCompress a byte stream.See the Codec.Compression.Zlib module for details about  and §.Ostreaming-utils-A specific compression level between 0 and 9.Qstreaming-utils!Decompress a gzipped byte stream.Rstreaming-utilsãDecompress a gzipped byte stream, returning any leftover input that follows the compressed stream.Sstreaming-utils*Compress a byte stream in the gzip format.©streaming-utilsProduce values from the given ª until exhausted.Gstreaming-utilsCompressed streamstreaming-utilsDecompressed streamHstreaming-utilsCompressed byte streamstreaming-utilsÂDecompressed byte stream, ending with either leftovers or a resultJstreaming-utilsDecompressed streamstreaming-utilsCompressed streamQstreaming-utilsCompressed streamstreaming-utilsDecompressed streamRstreaming-utilsCompressed byte streamstreaming-utils.Decompressed bytes stream, returning either a a< of the leftover input or the return value from the input a.Sstreaming-utilsDecompressed streamstreaming-utilsCompressed streamGHIJQRSFKLMNOPGHIJQRSFKLMNOP« !"#$%$&'()'(*'(+'(,'(-'./'.0'.1'.2'.3'.4'.5'.6'.7'.8'.9'.:;<=;<>;<?;@ABCDBCEBCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ‚„…†‡…ˆ‰…ˆŠ‹Œ‹ŒŽ‹Œ‘’‹Œ“‹Œ“‹Œ”‹Œ•‹Œ–‹Œ–‹Œ—‹Œ˜‹Œ™‹Œš‹Œ›‹Œœ‹Œ‹Œž‹ŒŸ‹Œ ‹Œ¡‹Œ¢‹Œ£‹Œ¤‹Œ¥‹Œ¦‹Œ§‹Œ¨‹Œ©‹Œª‹Œ«‹Œ¬‹Œ­‹Œ®‹Œ¯‹Œ°‹Œ±‹Œ²‹Œ³‹Œ´‹Œµ‹Œ¶‹Œ·‹Œo‹Œ¸‹Œ¹‹Œº‹Œ»‹Œ¼‹Œ½‹Œ¾‹Œ¿‹ŒÀ‹ŒÁ‹ŒÂ‹ŒÃ‹ŒÄ‹ŒÅ‹ŒÆ‹ŒÇ‹ŒÈ‹ŒÉ‹ŒÊ‹ŒË‹ŒË‹ŒÌ‹ŒÍ‹ŒÎ‹ŒÏ‹ŒÐ‹ŒÑ‹ŒÒ‹ŒÓ‹ŒÔ‹ŒÕ‹ŒÖ‹Œ×‹ŒØ‹Œ®‹ŒÙ‹ŒÚ‹ŒÛ‹ŒÜ‹ŒÝ‹ŒÞ‹Œß‹Œà‹Œá‹Œâ‹Œã‹Œä‹Œå‹Œæ‹Œç‹Œè‹Œé‹Œê‹Œë‹Œì‹Œí‹Œî‹Œï‹Œð‹ñò‹ñó‹ñô‹ñõ‹Œö‹Œ÷‹Œø‹Œù‹Œú‹ûü‹ûý‹ûþ‹ÿ€‹ÿ‹ÿ‚‹ƒ„‹ƒ…‹ƒ†‹ƒ‡‹ƒˆ‹ƒ‰‹ƒŠ‹ƒ‹‹ƒŒ‹ƒ‹ƒŽ‹ƒ‹ƒ‹ƒ‘‹ƒ’‹ƒ“‹ƒ”‹ƒ•‹ƒ–‹—˜‹™š‹™›‹™œ‹™‹™ž‹™Ÿ‹™ ‹™¡‹™¢‹™£‹™¤‹™¥‹™¦‹§¨‹§©‹§ª‹§«‹§¬‹§­‹§®‹§¯‹§°‹§±‹§²‹§³‹§´‹§µ‹§¶‹·¸‹·¹‹·º‹·»‹·¼‹·½‹ñ¾‹ñ¿‹ñÀ‹ñÁ‹ñ‹ñËñÄ‹ñÅ‹ñÆÇÈÉÇÈÊÇÈËÇÈÌÇÈÍÇÈÎÇÈÏÇÈÏÇÈÐÇÈÑÇÈÒÇÈÓÇÈÔÇÈÕÇÈÖÇÈ×ÇÈØÙÚÛBCÜÝÞßGHàáâãäåÃæ.streaming-utils-0.2.6.0-69H9ybnzSUpHWCTMWsCk8tStreaming.Network.TCPData.ByteString.Streaming.HTTPStreaming.Pipes Streaming.Zip$Data.Attoparsec.ByteString.StreamingData.ByteString.Streaming.Aesonstreaming-utils Data.AesonValueAFromJSONError Pipes.LifterrorP Pipes.AesondecodeddecodedLdecode parseValueControl.Monad.Trans.ErrorErrorTencodeData.JsonStream.ParserparseByteStringparseLazyByteString Control.MonadjoinZCompressionLevel&network-3.2.3.0-5ZNmeJcvSnoGPDfaglnHp7Network.Socket.TypesSocketSockAddrNetwork.Socket.Internal withSocketsDoNetwork.Socket.Info ServiceNameHostName+network-simple-0.4.5-5pJ33ZXJfZPJ5L8j8PaNe5Network.Simple.InternalHostPreferenceHostAnyHostIPv4HostIPv6HostNetwork.Simple.TCPconnectservelistenaccept acceptFork connectSockbindSock closeSockrecvsendsendLazysendMany%resourcet-1.3.0-J1x8HMLOo31wzhYs070eF%Control.Monad.Trans.Resource.Internal ResourceT MonadResource liftResourceTControl.Monad.Trans.Resource runResourceT(streaming-0.2.4.0-GVEjMm7NbEg8UU3i6ovkT3Streaming.Internalmaps intercalatestakes#zlib-0.7.1.0-CGuErZzQdopDLQfJcnDfAGCodec.Compression.Zlib.StreamdefaultWindowBitsMessageparseparsed DecodingErrorAttoparsecError FromJSONError streamParse$fExceptionDecodingError$fShowDecodingError$fEqDecodingError$fDataDecodingErrorwithHTTPstreamNstream simpleHTTPhttp fromSockettoSocket fromStreamtoStreamtoStreamingByteStringfromStreamingByteStringspanbreaksplitbreakssplitAtgroupBygroupgroupsBy groupsBy'groupschunksOfconcatsfoldsfoldsMtakes' decompress decompress' decompressAllcompressdefaultCompression noCompression bestSpeedbestCompressioncompressionLevel windowBitsgunzipgunzip'gzip$fShowCompressionLevel$fReadCompressionLevel$fEqCompressionLevel$fOrdCompressionLevel ParsingErrorbase Data.EitherLeftEither$aeson-2.2.3.0-66hzmTLqxmE3QChFLkFkiVData.Aeson.Types.ToJSONToJSONData.Aeson.Types.InternalArrayObject)http-client-0.7.17-AxUljSMvEZaEhulr32aJzRNetwork.HTTP.Client.TypesRequestResponse RequestBody1streaming-bytestring-0.3.2-LbZ0FV3i08w1ZbPPrgKovDStreaming.ByteString.Internal ByteStringProxy proxyHost proxyPortStreamFileStatusfileSize readSoFar thisChunkSizeHasHttpManagergetHttpManagerManager ProxyOverrideManagerSettingsmanagerConnCountmanagerRawConnectionmanagerTlsConnectionmanagerResponseTimeoutmanagerRetryableExceptionmanagerWrapExceptionmanagerIdleConnectionCountmanagerModifyRequestmanagerModifyResponseresponseStatusresponseVersionresponseHeaders responseBodyresponseCookieJarresponseEarlyHintsResponseTimeoutpathmethodsecurehostport queryStringrequestHeaders requestBodyproxy redirectCount checkResponseresponseTimeout cookieJarrequestVersionshouldStripHeaderOnRedirect0shouldStripHeaderOnRedirectIfOnDifferentHostOnly redactHeadersearlyHintHeadersReceived GivesPopper NeedsPopperPopperRequestBodyLBS RequestBodyBSRequestBodyBuilderRequestBodyStreamRequestBodyStreamChunked RequestBodyIO CookieJarCookie cookie_name cookie_valuecookie_expiry_time cookie_domain cookie_pathcookie_creation_timecookie_last_access_timecookie_persistentcookie_host_onlycookie_secure_onlycookie_http_onlyHttpExceptionContent InvalidHeaderStatusCodeExceptionTooManyRedirectsOverlongHeadersConnectionTimeoutConnectionFailureInvalidStatusLineInvalidRequestHeaderInternalExceptionProxyConnectExceptionNoResponseDataReceivedTlsNotSupportedWrongRequestBodyStreamSizeResponseBodyTooShortInvalidChunkHeadersIncompleteHeadersInvalidDestinationHostHttpZlibExceptionInvalidProxyEnvironmentVariableConnectionClosedInvalidProxySettings HttpExceptionHttpExceptionRequestInvalidUrlException BodyReaderNetwork.HTTP.ClientHistoriedResponse hrRedirectshrFinalRequesthrFinalResponse equalCookie equivCookiecompareCookiesequalCookieJarequivCookieJarNetwork.HTTP.Client.ConnectionmakeConnectionsocketConnectionstrippedHostNameNetwork.HTTP.Client.BodybrRead brReadSome brConsumeNetwork.HTTP.Client.RequestparseUrl parseUrlThrowthrowErrorStatusCodes parseRequest parseRequest_requestFromURIrequestFromURI_getUridefaultRequestapplyBasicAuthapplyBearerAuthapplyBasicProxyAuthurlEncodedBodysetRequestIgnoreStatussetRequestCheckStatussetQueryStringsetQueryStringPartialEscape streamFileobservedStreamFileNetwork.HTTP.Client.ResponsegetOriginalRequestNetwork.HTTP.Client.ManagerrawConnectionModifySocketrawConnectionModifySocketSizedefaultManagerSettings newManager closeManager withManagerproxyFromRequestnoProxyuseProxyuseProxySecureWithoutConnectproxyEnvironmentproxyEnvironmentNamed defaultProxyNetwork.HTTP.Client.Cookies isIpAddress domainMatches defaultPath pathMatchescreateCookieJardestroyCookieJar!removeExistingCookieFromCookieJarisPotentiallyTrustworthyOriginevictExpiredCookiesinsertCookiesIntoRequestcomputeCookieStringupdateCookieJarreceiveSetCookieinsertCheckedCookiegenerateCookieNetwork.HTTP.Client.Core withResponsehttpLbs httpNoBody responseOpen responseClosewithConnectionresponseOpenHistorywithResponseHistorymanagerSetInsecureProxymanagerSetSecureProxymanagerSetProxymanagerSetMaxHeaderLengthresponseTimeoutMicroresponseTimeoutNoneresponseTimeoutDefault.http-client-tls-0.3.6.3-3SlfFL1IUBE4on5npSi9PuNetwork.HTTP.Client.TLSDigestAuthExceptionDetailsUnexpectedStatusCodeMissingWWWAuthenticateHeaderWWWAuthenticateIsNotDigest MissingRealm MissingNonceDigestAuthExceptionmkManagerSettingsmkManagerSettingsContexttlsManagerSettings newTlsManagernewTlsManagerWithgetGlobalManagersetGlobalManagerdisplayDigestAuthExceptionapplyDigestAuth#pipes-4.3.16-7iClLSXOjdC1blARGmdBcb Pipes.CoreProducerStreamghc-prim GHC.Classes== WindowBitsControl.Monad.IO.ClassMonadIO fromPopper0streaming-commons-0.2.2.6-IOF2f0mxn9JIwXoKFj0vr2Data.Streaming.Zlib