_P$      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { |}~ Safe-InferredNoneA 9 is a coroutine monad that can be used to define complex  !s. You can cause a value of type Just r to appear when the   is read by calling :    g ::  Int ()  g = do  Streams. 1  Streams. 2  Streams. 3 A  can be turned into an  by calling  :    m ::  []  m = Streams. g >>= Streams. -- value returned is [1,2,3] You can perform IO by calling  , and turn a  into an   with . JAs a general rule, you should not acquire resources that need to be freed  from a ;, because there is no guarantee the coroutine continuation C will ever be called, nor can you catch an exception from within a  . 0Internal convenience synonym for a pair of input/output streams. An  consumes values of type c in the  monad. ) The only primitive operation defined on  is:    ::  c ->  c ->  ()Values of type c are written in an  by wrapping them in  9, and the end of the stream is indicated by by supplying . If you supply a value after a !, the behavior is defined by the  implementer of the given . (All  definitions in 4 this library will simply discard the extra input.) An  generates values of type c in the  monad. (Two primitive operations are defined on :    ::  c ->  ( c) reads a value from the stream,  where " end of stream" is signaled by   returning .   :: c ->  c ->  () " pushes back" a value to the  stream. It is intended that s obey the following law:  c stream >>   stream ===  ( c) A strict pair type. Reads one value from an . $Returns either a value wrapped in a , or  if the end of the  stream is reached. Feeds a value to an . Values of type c are written in an   by wrapping them in , and the end of the stream is  indicated by by supplying . !Observes the first value from an  without consuming it. Returns  if the  is empty.  satisfies the  following law:   Streams. stream >> Streams.  stream === Streams.  stream *Pushes a value back onto an input stream.   and  should I satisfy the following law, with the possible exception of side effects:    Streams. c stream >> Streams.  stream ===  ( c) LNote that this could be used to add values back to the stream that were not # originally drawn from the stream.  Connects an  and , supplying values from the   to the $, and propagating the end-of-stream  message from the  through to the . The connection ends when the  yields a . The  function is just  . $Useful for writing expressions like fromList [1,2,3] >>= connectTo foo.  Connects an  to an  without passing the + end-of-stream notification through to the . Use this to supply an  with multiple  s and use   for the final  to finalize the , like  so:   do Streams. input1 output  Streams. input2 output  Streams. input3 output  with the arguments flipped.  Creates an  from a value-producing action. (makeInputStream m) calls the action m each time you request a value  from the 0. The given action is extended with the default  pushback mechanism (see #System.IO.Streams.Internal#pushback).  Creates an  from a value-consuming action. (makeOutputStream f) runs the computation f on each value fed to it.  Converts an  into a thread-safe , at a slight  performance penalty. JFor performance reasons, this library provides non-thread-safe streams by  default. Use the locking2 functions to convert these streams into slightly ' slower, but thread-safe, equivalents.  Converts an  into a thread-safe , at a slight  performance penalty. JFor performance reasons, this library provides non-thread-safe streams by  default. Use the locking2 functions to convert these streams into slightly ' slower, but thread-safe, equivalents.  An empty  that yields  immediately.  An empty $ that discards any input fed to it.  concatenates two s, analogous to ()  for lists.  The second  continues where the first  ends. Note: values pushed back to  are not propagated to either  wrapped .  concatenates a list of s, analogous to  ( ) for lists.  Subsequent "s continue where the previous one   ends.  Note: values pushed back to the  returned by  ) are not propagated to any of the source  s.  Checks if an  is at end-of-stream. Calling  x causes the value  x to appear on the input ( when this generator is converted to an . The rest of the  computation after the call to  is resumed later when the   is   again. Turns a  into an . ;  !  !     1   None!(An exception raised when parsing fails. # Supplies an  attoparsec  with an , returning the  final parsed value or a ! if parsing fails. #9 consumes only as much input as necessary to satisfy the  . and unconsumed input is pushed back onto the . If the  exhausts the , it receives an EOF.  Example:   ghci> import  Data.Attoparsec.ByteString.Char8  ghci> is <-  ["12345xxx" :: ]  ghci> # ( ) is  "12345"  ghci>  is  Just "xxx" IInternal version of parseFromStream allowing dependency injection of the  parse functions for testing. $Given a  yielding values of type  r, transforms an   over byte strings to an  yielding values of type  r. If the parser yields Just x, then x& will be passed along downstream, and  if the parser yields Nothing-, that will be interpreted as end-of-stream. Upon a parse error, $ will throw a !.  Example:   ghci> import Control.Applicative  ghci> import  Data.Attoparsec.ByteString.Char8  ghci> is <-  [" 1 2 3 4 5" :: ]  ghci> let parser = ( >>  ) <|> (Just <$> (  *> ))  ghci> $ parser is >>=   [1,2,3,4,5]  ghci> is' <-  [" 1 2xx3 4 5" :: ] >>= $ parser  ghci> read is'  Just 1  ghci> read is'  Just 2  ghci> read is' < *** Exception: Parse exception: Failed reading: takeWhile1 !"#$!"#$!"#$None!"#$#$!"None%%; provides match information when performing string search. KDoes the given needle match the haystack over the given ranges of indices? (Given a  to look for (the "needle" ) and an ,  produces a new  which yields data of type %.  Example:    ghci>  ["food", "oof", "oodles", "ok"] >>=  ( "foo" >>=   [' "foo",& "d",& "oo",' "foo",& "dlesok"] (Uses the Boyer-Moore-Horspool algorithm  ( Khttp://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm). %&'needle  needle start needle end (inclusive)  haystack haystack start haystack end (inclusive) ("needle" to look for input stream to wrap %&'(%'&(None)KWrites the contents of an input stream to a channel until the input stream  yields end-of-stream. *Turns a  into an input stream. +Turns a  into an output stream. ,Concurrently merges a list of s, combining values in the  order they become available.  Note: does not5 forward individual end-of-stream notifications, the M produced stream does not yield end-of-stream until all of the input streams  have finished. JThis traps exceptions in each concurrent thread and re-raises them in the  current thread. -1Create a new pair of streams using an underlying . Everything written  to the  will appear as-is on the . Since reading from the  and writing to the  are 8 blocking calls, be sure to do so in different threads. )*+,-)*+,-)*+,-)*+,- None   None.'function to convert stream elements to   #name of this debug stream, will be  prepended to debug output &stream the debug info will be sent to  input stream /#name of this debug stream, will be  prepended to debug output &stream the debug info will be sent to  input stream 0function to convert stream  elements to  #name of this debug stream, will be  prepended to debug output  debug stream output stream 1#name of this debug stream, will be  prepended to debug output &stream the debug info will be sent to output stream ./01.0/1./01None2Transforms a vector into an  that yields each of the values  in the vector in turn.   ghci> import  Control.Monad  ghci> import qualified System.IO.Streams as Streams  ghci> import qualified  Data.Vector as V  ghci> let v = V.! [1, 2]  ghci> is < - Streams.2 v  ghci> "# 3 (Streams. is)  [ 1, 2,] 3 Drains an ,, converting it to a vector. Note that this  function reads the entire % strictly into memory and as such is N not recommended for streaming applications or where the size of the input is  not bounded or known.   ghci> is < - Streams. [(1::Int)..4]  ghci> Streams.3 is ::  (V. Int)  fromList [1,2,3,4] 4Like 3<, but allows control over how large the vector buffer is to  start with. 5 Drains an 4, converting it to a mutable vector. Note that this  function reads the entire % strictly into memory and as such is N not recommended for streaming applications or where the size of the input is  not bounded or known. 6Like 5/, but allows control over how large the vector  buffer is to start with. 77 returns an  which stores values fed D into it and an action which flushes all stored values to a vector. #The flush action resets the store. Note that this function will* buffer any input sent to it on the heap.  Please don't use this unless you'*re sure that the amount of input provided 3 is bounded and will fit in memory without issues.   ghci> (os, flush) < - Streams.7 :: IO ( Int, IO (V. Int))  ghci> Streams.$ (Just 1) os  ghci> Streams.$ (Just 2) os  ghci> flush  fromList [1,2]  ghci> Streams.$ (Just 3) os  ghci> Streams.$ Nothing os  ghci> Streams.$ (Just 4) os  ghci> flush  fromList [3] 8Like 7/, but allows control over how large the vector  buffer is to start with. 99 returns an  which stores values H fed into it and an action which flushes all stored values to a vector. #The flush action resets the store. Note that this function will* buffer any input sent to it on the heap.  Please don't use this unless you'*re sure that the amount of input provided 3 is bounded and will fit in memory without issues. :Like 9(, but allows control over how large the ! vector buffer is to start with. ;$Given an IO action that requires an , creates one and E captures all the output the action sends to it as a mutable vector.  Example:   ghci> import Control.Applicative  ghci> (connect <$>  [1, 2, 3::])  >>= ;  >>= V.!%  fromList [1,2,3] <Like ;/, but allows control over how large the vector  buffer is to start with. =$Given an IO action that requires an , creates one and = captures all the output the action sends to it as a vector.  Example:   ghci> ((connect  $  [1, 2, 3]) >>= =)  :: IO (!& Int)  fromList [1,2,3] >Like =6, but allows control over how large the vector buffer  is to start with. ?3Splits an input stream into chunks of at most size n.  Example:   ghci> ( [1..14::Int] >>= ? 4 >>= )  :: IO [!& Int]  [fromList [1,2,3,4],fromList [5,6,7,8],fromList [9,10,11,12],fromList [13,14]] @Feeds a vector to an . Does not write an end-of-stream to  the stream.   ghci> let v = V.fromList [1..4] :: V. Int  ghci> os < - Streams. Streams.stdout >>= Streams.' (S.pack . show) :: IO ( Int)  ghci> Streams.@ v os  1  2  3  4 23456"initial size of the vector buffer 789:;<=>?@23456789:;<=>?@234=>56;<@?789:23456789:;<=>?@NoneA Converts a  to an  /  pair. Note that,  as is usually the case in  io-streams , writing a  to the generated   does not cause the underlying  to be closed. B Converts a  to an  /  pair, with L control over the size of the receive buffers. Note that, as is usually the  case in  io-streams , writing a  to the generated   does not cause the underlying  to be closed. AB'how large the receive buffer should be network socket ABABABNoneCTransforms a list into an  that produces no side effects.   ghci> is < - Streams.C [1, 2]  ghci>  replicateM 3 (Streams.  is)  [Just 1, Just 2, Nothing] DD returns an  which stores values fed into = it and an action which flushes all stored values to a list. #The flush action resets the store. Note that this function will* buffer any input sent to it on the heap.  Please don't use this unless you'*re sure that the amount of input provided 3 is bounded and will fit in memory without issues.   ghci> (os, flush) < - Streams.D :: IO ( Int, IO [Int])  ghci> Streams.G [1, 2] os  ghci> flush  [1, 2]  ghci> Streams.G [3, 4] os  ghci> flush  [3, 4] E Drains an 3, converting it to a list. N.B. that this function  reads the entire ) strictly into memory and as such is not N recommended for streaming applications or where the size of the input is not  bounded or known.   ghci> is < - Streams.C [1, 2]  ghci> Streams.E is  [1, 2] F$Given an IO action that requires an , creates one and ; captures all the output the action sends to it as a list.  Example:   ghci> import Control.Applicative  ghci> (  $ C ["a", "b", "c"]) >>= F  ["a","b","c"] GFeeds a list to an . Does not write an end-of-stream to  the stream.   ghci> os < - Streams. Streams.( >>= Streams.' (S.pack . show) :: IO ( Int)  ghci> Streams.G [1, 2] os  1  2  ghci> Streams.G [3, 4] os  3  4 H3Splits an input stream into chunks of at most size n.  Example:   ghci> C [1..14::Int] >>= H 4 >>= E  [[1,2,3,4] ,[5,6,7,8] ,[9,10,11,12],[13,14]] IIGiven an input stream containing lists, produces a new input stream that 2 will yield the concatenation of these lists. See .  Example:   ghci> Streams.C [[1,2,3::Int], [4,5,6]] >>=  Streams.I >>=  Streams.E  [1,2,3,4,5,6] CDEFGH chunk size stream to process ICDEFGHICEFGHIDCDEFGHI  TrustworthyJ$Converts a read-only handle into an  of strict s.  Note that the wrapped handle is not& closed when it yields end-of-stream;  you can use  ) to close the handle # if you would like this behaviour. K#Converts a writable handle into an  of strict s.  Note that the wrapped handle is not( closed when it receives end-of-stream;  you can use  * to close the * handle if you would like this behaviour. L Converts an ! over bytestrings to a read-only . Note H that the generated handle is opened unbuffered in binary mode (i.e. no $ newline translation is performed).  Note: the ) passed into this function is wrapped in   to make it thread-safe. Since: 1.0.2.0. M Converts an " over bytestrings to a write-only . Note  that the 9 will be opened in non-buffering mode; if you buffer the   using the  buffering then  io-streams will copy the   buffer when sending # values to the output, which might M not be what you want. When the output buffer, if used, is flushed, an empty D string is written to the output, as is conventional throughout the   io-streams library for  output buffers.  Note: the ) passed into this function is wrapped in   to make it thread-safe. Since: 1.0.2.0. NConverts a pair of  and  over bytestrings to a  read-write . ;Note: the streams passed into this function are wrapped in . locking primitives to make them thread-safe. Since: 1.0.2.0. OAn  for . PAn  for . QAn  for . JKLMNOPQJKLMNOPQJKLMNOPQ JKLMNOPQ NoneRR name act opens the specified file in " read mode" and  passes the resulting  to the computation act. The file will  be closed on exit from withFileAsInput#, whether by normal termination or  by raising an exception. .If closing the file raises an exception, then that exception will be  raised by R% rather than any exception raised by act. SLike R0, but seeks to the specified byte offset before , attaching the given file descriptor to the . TLike S, except that the  emitted by  the created - may reuse its buffer. You may only use this G function if you do not retain references to the generated bytestrings  emitted. U)Open a file for writing and attaches an  for you to write D to. The file will be closed on error or completion of your action. VLike U0, but allowing you control over the output file  mode and buffering behaviour. R file to open function to run Sstarting index to seek to  file to open function to run Tstarting index to seek to  file to open function to run U file to open function to run V file to open mode to write in should we buffer the output? function to run RSTUVRSTUVRSTUV None WA side-effecting fold over an , as a stream transformer. The IO action returned by W" can be used to fetch the updated  seed value. Example:   ghci> is < - Streams. [1, 2, 3::Int]  ghci> (os, getList) < - Streams.+  ghci> (os' , getSeed) < - Streams.W (\x y -> return (x+y)) 0 os  ghci> Streams., is os'  ghci> getList  [1,2,3]  ghci> getSeed  6 XA side-effecting fold over an , as a stream transformer. The IO action returned by X' can be used to fetch the updated seed  value. Example:   ghci> is < - Streams. [1, 2, 3::Int]  ghci> (is' , getSeed) < - Streams.X (\x y -> return (x+y)) 0 is  ghci> Streams. is'  [1,2,3]  ghci> getSeed  6 YJA left fold over an input stream. The input stream is fully consumed. See  .  Example:   ghci> Streams. [1..10] >>= Streams.Y (+) 0  55 ZKA side-effecting left fold over an input stream. The input stream is fully  consumed. See .  Example:   ghci> Streams. [1..10] >>= Streams.Z (x y ->  (x + y)) 0  55 [any predicate stream returns  if any element in stream matches  the predicate. [H consumes as few elements as possible, ending consumption if an element  satisfies the predicate.   ghci> is < - Streams. [1, 2, 3]  ghci> Streams.[% (> 0) is -- Consumes one element  True  ghci> Streams. is  Just 2  ghci> Streams.[ even is -- Only 3 remains  False \all predicate stream returns  if every element in stream matches  the predicate. \I consumes as few elements as possible, ending consumption if any element  fails the predicate.   ghci> is < - Streams. [1, 2, 3]  ghci> Streams.\ (<" 0) is -- Consumes one element  False  ghci> Streams. is  Just 2  ghci> Streams.\ odd is -- Only 3 remains  True ]maximum stream! returns the greatest element in stream or  if  the stream is empty. ] consumes the entire stream.   ghci> is < - Streams. [1, 2, 3]  ghci> Streams.] is  3  ghci> Streams.# is -- The stream is now empty  Nothing ^minimum stream! returns the greatest element in stream ^ consumes the entire stream.   ghci> is < - Streams. [1, 2, 3]  ghci> Streams.^ is  1  ghci> Streams." is -- The stream is now empty  Nothing _unfoldM f seed builds an  from successively applying f to  the seed value, continuing if f produces  and halting on  .   ghci> is < - Streams._ (n -> return $ if n <( 3 then Just (n, n + 1) else Nothing) 0  ghci> Streams. is  [0,1,2] `Maps a pure function over an . map f s passes all output from s through the function f. Satisfies the following laws:   Streams.` (g . f) === Streams.` f >=> Streams.` g  Streams.`  === Streams. . Streams.  a Maps an impure function over an . mapM f s passes all output from s through the IO action f. Satisfies the following laws:   Streams.a (f >=> g) === Streams.a f >=> Streams.a g  Streams.a  === Streams. . Streams.  bMaps a side effect over an .  mapM_ f s9 produces a new input stream that passes all output from s & through the side-effecting IO action f.  Example:   ghci> Streams. [1,2,3] >>=  Streams.b ( .  . (*2)) >>=  Streams.  2  4  6  [1,2,3] cContravariant counterpart to `.  contramap f s passes all input to s through the function f. Satisfies the following laws:   Streams.c (g . f) === Streams.c g >=> Streams.c f  Streams.c  ===  dContravariant counterpart to a. contramapM f s passes all input to s through the IO action f Satisfies the following laws:   Streams.d (f >=> g) = Streams.d g >=> Streams.d f  Streams.d  =  eEquivalent to b for output. contramapM f s passes all input to s through the side-effecting IO  action f. f Drives an 1 to end-of-stream, discarding all of the yielded  values. gGDrops chunks from an input stream if they fail to match a given filter  predicate. See -.. GItems pushed back to the returned stream are propagated back upstream.  Example:   ghci> Streams. ["the", "quick", "brown", "fox"] >>=  Streams.g ( . (/= "brown")) >>= Streams.  ["the","quick","fox"] hGDrops chunks from an input stream if they fail to match a given filter  predicate. See -.. GItems pushed back to the returned stream are propagated back upstream.  Example:   ghci> Streams. ["the", "quick", "brown", "fox"] >>=  Streams.h (/= "brown") >>= Streams.  ["the","quick","fox"] i The function intersperse v s wraps the  s , creating a , new output stream that writes its input to s interspersed with the  provided value v. See /0.  Example:  $ ghci> import Control.Monad ((>=>))  ghci> is < - Streams. ["nom", "nom", "nom":: ByteString]  ghci> Streams.1 (Streams.i "burp!" >=> Streams., is)  ["nom","burp!","nom","burp!","nom"] jHCombines two input streams. Continues yielding elements from both input % streams until one of them finishes. kKCombines two input streams using the supplied function. Continues yielding > elements from both input streams until one of them finishes. lJCombines two input streams using the supplied monadic function. Continues G yielding elements from both input streams until one of them finishes. m'Filters output to be sent to the given  using a pure  function. See h.  Example:   ghci> import qualified Data.ByteString.Char8 as S  ghci> os1 < - Streams.( >>= Streams.'System.IO.Streams.unlines  ghci> os2 <- os1 >>= Streams.c (S.pack . show) >>= Streams.m even  ghci> Streams.  (Just 3) os2  ghci> Streams.  (Just 4) os2  4 n'Filters output to be sent to the given  using a predicate  function in IO. See g.  Example:  ! ghci> let check a = putStrLn a (Allow  ++ show a ++ ?) >> readLn :: IO Bool 3 ghci> import qualified Data.ByteString.Char8 as S  ghci> os1 < - Streams.2 Streams.(  ghci> os2 <- os1 >>= Streams.c (S.pack . show) >>= Streams.n check  ghci> Streams.$ (Just 3) os2  Allow 3?  False<Enter>  ghci> Streams.$ (Just 4) os2  Allow 4?  True<Enter>  4 oJTakes apart a stream of pairs, producing a pair of input streams. Reading N from either of the produced streams will cause a pair of values to be pulled : from the original stream if necessary. Note that reading n values from one $ of the returned streams will cause n$ values to be buffered at the other  stream. FAccess to the original stream is thread safe, i.e. guarded by a lock. p Wraps an , producing a new  that will produce at  most n5 items, subsequently yielding end-of-stream forever. "Items pushed back to the returned  will be propagated upstream, 1 modifying the count of taken items accordingly.  Example:   ghci> is < - Streams.fromList [1..9::Int]  ghci> is' < - Streams.p 1 is  ghci> Streams.  is'  Just 1  ghci> Streams.  is'  Nothing  ghci> Streams.3 is  Just 2  ghci> Streams. 11 is'  ghci> Streams.3 is  Just 11  ghci> Streams.3 is'  Just 11  ghci> Streams.  is'  Just 11  ghci> Streams.  is'  Nothing  ghci> Streams.  is  Just 2  ghci> Streams.toList is  [3,4,5,6,7,8,9] q Wraps an , producing a new  that will drop the  first n+ items produced by the wrapped stream. See -4. "Items pushed back to the returned  will be propagated upstream, 3 modifying the count of dropped items accordingly. r Wraps an , producing a new  that will pass at  most nC items on to the wrapped stream, subsequently ignoring the rest of  the input. s Wraps an , producing a new  that will ignore  the first n? items received, subsequently passing the rest of the input on  to the wrapped stream. t Wraps an , ignoring any end-of-stream  values ! written to the returned stream. Since: 1.0.1.0 u Wraps an /, running the specified action when the stream  yields end-of-file. Since: 1.0.2.0 v Wraps an /, running the specified action when the stream  receives end-of-file. Since: 1.0.2.0 Wfold function  initial seed output stream  returns a new stream as well as # an IO action to fetch the updated  seed value. Xfold function  initial seed  input stream #returns a new stream as well as an % IO action to fetch the updated seed  value. Yfold function  initial seed  input stream Zfold function  initial seed  input stream [\]^_`abcdefghijklmnopqrstuv WXYZ[\]^_`abcdefghijklmnopqrstuv XWYZ[\]^_`abcdehgmnrpqsjkloiftuv WXYZ[\]^_`abcdefghijklmnopqrstuv NonewHRuns a command using the shell, and returns streams that may be used to N communicate with the process via its stdin, stdout, and stderr respectively. LThe streams returned by this command are guarded by locks and are therefore $ safe to use in multithreaded code. Since: 1.0.2.0 xHRuns a raw command, and returns streams that may be used to communicate  with the process via its stdin, stdout and stderr respectively. @For example, to start a process and feed a string to its stdin:  2 (inp,out,err,pid) <- runInteractiveProcess "..." ' forkIO (Streams.write (Just str) inp) LThe streams returned by this command are guarded by locks and are therefore $ safe to use in multithreaded code. Since: 1.0.2.0 wx Filename of the executable (see  for details) $Arguments to pass to the executable 'Optional path to the working directory )Optional environment (otherwise inherit) wxwxwx Noney Convert an  taking s to an  that  takes ", encoding the data as UTF-8. See  Data.Text.Encoding.. z Decode an  of s in UTF-8 format into an   of 5 values. If decoding fails, will throw an exception.  See Data.Text.Encoding.. { Decode an  of s in UTF-8 format into an   of . values. If decoding fails, invokes the given  $ function to decide what to do. See  Data.Text.Encoding..      yz{yz{z{y      yz{None| Thrown by / if input is not being produced fast enough by  the given . } Thrown by 4 when not enough bytes were available on the input. ~ Thrown by & when too many bytes were sent to the  produced .  Thrown by 1 when too few bytes were written to the produced  .  Thrown by ( when too many bytes were read from the  original . Writes a lazy  to an .  Example:   ghci> Streams. "Test\n" Streams.(  Test  Creates an  from a .  Creates an  from a lazy .  Wraps an /, counting the number of bytes produced by the ) stream as a side effect. Produces a new  as well as an IO 1 action to retrieve the count of bytes produced. $Strings pushed back to the returned  will be pushed back to the E original stream, and the count of produced bytes will be subtracted  accordingly.  Example:   ghci> is < - Streams. ["abc", "def", "ghi" ::ByteString]  ghci> (is' , getCount) < - Streams. is  ghci> Streams.  is'  Just "abc"  ghci> getCount  3  ghci> Streams. "bc" is'  ghci> getCount  1  ghci> Streams.3 is  Just "bc"  ghci> Streams. is'  ["bc","def","ghi"]  ghci> getCount  9  Wraps an /, counting the number of bytes consumed by the ) stream as a side effect. Produces a new  as well as an IO 1 action to retrieve the count of bytes consumed.  Example:  0 ghci> (os :: OutputStream ByteString, getList) < - Streams.+  ghci> (os' , getCount) < - Streams. os  ghci> Streams. ["abc", "def", "ghi"] >>= Streams.5 os'  ghci> getList  ["abc","def","ghi"]  ghci> getCount  9  Wraps an , producing a new  that will produce at  most n5 bytes, subsequently yielding end-of-stream forever. $Strings pushed back to the returned  will be propagated ; upstream, modifying the count of taken bytes accordingly.  Example:   ghci> is < - Streams. [" truncated", " string" ::ByteString]  ghci> is' < - Streams. 9 is  ghci> Streams.  is'  Just " truncated"  ghci> Streams.  is'  Nothing  ghci> Streams.3 is  Just " string"  ghci> Streams. "cated" is'  ghci> Streams.3 is  Just "cated"  ghci> Streams.3 is'  Just "cated"  ghci> Streams.  is'  Just "cated"  ghci> Streams.  is'  Nothing  ghci> Streams.  is  Just " string"  Splits an  over s using a delimiter predicate.  Note that:  data pushed back with $ is *not* propagated upstream here.  the resulting % may hold an unbounded amount of the K bytestring in memory waiting for the function to return true, so this 5 function should not be used in unsafe contexts. . the delimiter is NOT included in the output. ( consecutive delimiters are not merged.  Example:   ghci> Streams. [" the quick br", "own fox"::] >>=  Streams. (== ' ') >>= Streams.  ["the","quick","brown","","fox"] Splits a bytestring  into lines. See  and  -6.  Example:    ghci> is < - Streams. ["Hello,\n world!"] >>= Streams.  ghci> replicateM 3 (Streams.  is)  [Just "Hello", Just ", world!" , Nothing] KNote that this may increase the chunk size if the input contains extremely  long lines. Splits a bytestring  into words. See  and  -7.  Example:    ghci> is < - Streams. [" Hello, world!"] >>= Streams.  ghci> replicateM 3 (Streams.  is)  [Just "Hello,", Just "world!" , Nothing] KNote that this may increase the chunk size if the input contains extremely  long words. -Intersperses string chunks sent to the given  with newlines.  See i and -2.   ghci> os < - Streams. Streams.(  ghci> Streams.  (Just "Hello,") os  Hello  ghci> Streams.  Nothing os  ghci> Streams.  (Just "world!") os  world! -Intersperses string chunks sent to the given  with spaces.  See i and -8.   ghci> os < - Streams. Streams.(  ghci> forM_ [Just "Hello,", Nothing, Just "world!\n"] $ w -> Streams.  w os  Hello, world!  Wraps an . If more than n bytes are produced by this  stream,   will throw a . AIf a chunk yielded by the input stream would result in more than n bytes  being produced, $ will cut the generated string such  that exactly n3 bytes are yielded by the returned stream, and the   subsequent( read will throw an exception. Example:    ghci> is < - Streams. ["abc", "def", "ghi"] >>=  Streams. 5  ghci> "# 2 (  is)  [Just "abc",Just "de"]  ghci> Streams.  is $ *** Exception: Too many bytes read $Strings pushed back to the returned  will be propagated D upstream, modifying the count of taken bytes accordingly. Example:   ghci> is < - Streams. ["abc", "def", "ghi"]  ghci> is' < - Streams. 5 is  ghci> Streams.  is'  Just "abc"  ghci> Streams. "xyz" is'  ghci> Streams.3 is  Just "xyz"  ghci> Streams.  is  Just "xyz"  ghci> Streams.  is  Just "de"  ghci> Streams.  is $ *** Exception: Too many bytes read  Reads an n0-byte ByteString from an input stream. Throws a  } if fewer than n bytes were available.  Example:   ghci> Streams. [" long string"] >>= Streams. 6  "long s"  ghci> Streams. ["short"] >>= Streams. 6 - *** Exception: Short read, expected 6 bytes FTakes from a stream until the given predicate is no longer satisfied. & Returns Nothing on end-of-stream, or Just "" if the predicate is never  satisfied. See - and 9.  Example:   ghci> Streams. [" Hello, world!"] >>= Streams. (/= ',')  Just "Hello"  ghci> import Data.Char  ghci> Streams. [" 7 Samurai"] >>= Streams. isAlpha  Just ""  ghci> Streams. [] >>= Streams. isAlpha  Nothing  Wraps an 1, producing a new stream that will pass along at  most nB bytes to the wrapped stream, throwing any subsequent input away.  Example:  0 ghci> (os :: OutputStream ByteString, getList) < - Streams.+  ghci> os' < - Streams. 6 os  ghci> Streams. ["long ", "string"] >>= Streams.5 os'  ghci> getList  ["long ","s"]  Wraps an ., producing a new stream that will pass along  exactly nB bytes to the wrapped stream. If the stream is sent more or fewer N than the given number of bytes, the resulting stream will throw an exception  (either  or ~)  during a call to  .  Example:   ghci> is < - Streams. ["ok"]  ghci> Streams.1 (Streams. 2 >=> Streams., is)  ["ok"]  ghci> is < - Streams. ["ok"]  ghci> Streams.1 (Streams. 1 >=> Streams., is) ' *** Exception: Too many bytes written  ghci> is < - Streams. ["ok"]  ghci> Streams.1 (Streams. 3 >=> Streams., is) & *** Exception: Too few bytes written  Wraps an 1, producing a new stream that will pass along at  most n+ bytes to the wrapped stream. If more than n bytes are sent to the  outer stream, a ~ will be thrown. Note: if more than n% bytes are sent to the outer stream,  % will not necessarily send the first n bytes > through to the wrapped stream before throwing the exception.  Example:  0 ghci> (os :: OutputStream ByteString, getList) < - Streams.+  ghci> os' < - Streams. 5 os  ghci> Streams. ["short"] >>= Streams.5 os'  ghci> getList  ["short"]  ghci> os'' < - Streams. 5 os  ghci> Streams. ["long", "string"] >>= Streams.5 os'' ' *** Exception: Too many bytes written Gets the current posix time IRate-limits an input stream. If the input stream is not read from faster C than the given rate, reading from the wrapped stream will throw a  |. $Strings pushed back to the returned  will be propagated up to  the original stream. (|}~string to write to output output stream  maximum number of bytes to read input stream to wrap "predicate used to break the input  stream into chunks  input stream  maximum number of bytes to read  input stream number of bytes to read  input stream  predicate  input stream  maximum number of bytes to send  to the wrapped stream output stream to wrap 'maximum number of bytes to send to the  wrapped stream output stream to wrap action to bump timeout 'minimum data rate, in bytes per second )amount of time in seconds to wait before & data rate calculation takes effect  input stream  !"%&'(|}~%'&(|}~#|}~ !"None Converts a  sink into a # sink. .Note that if the generated builder receives a  :;-, by convention it will send an empty string  to the supplied   to indicate that any output  buffers are to be flushed. Unsafe variation on $ that reuses an existing buffer for  efficiency. NOTE+: because the buffer is reused, subsequent  values written  to the wrapped  OutputString0 will cause previous yielded strings to change. # Do not retain references to these  values inside the  < you pass to this function, or you will violate referential  transparency. If you must0 retain copies of these values, then please use  <=- to ensure that you have a fresh copy of the  underlying string. You can create a Buffer with  >?. A customized version of , using the specified  $. NoneHParameter that defines the tradeoff between speed and compression ratio Decompress an  of strict  s from the gzip format Decompress an  of strict  s from the zlib format  Convert an  that consumes compressed # s into an   that consumes uncompressed # s in the gzip format  Convert an  that consumes compressed # s into an   that consumes uncompressed # s in the zlib format ?A compression level that balances speed with compression ratio  Convert an  that consumes compressed  s into an   that consumes uncompressed  s in the gzip format  Convert an  that consumes compressed  s into an   that consumes uncompressed  s in the zlib format %&'()*+,-. %('&)*+,-.None %&'(23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  /@ABCCDEEFGHH$3I,5JKLMNOPQRSTUVWXYYZ[\]^_`abcdefghijklmnopqrstuvwxy+1z{| } ~  ( ' . 0 4 ) * 6728@A&/2      (   !"#$%$&$'$($)$*$+$,$-$-$.$/$0$1$2$3$4567585859:58 ; < = > ? @ A B C D E FGHIJKLMNOPQRSTUS>VWXYZ[\]^_`aio-streams-1.1.2.0System.IO.Streams.InternalSystem.IO.Streams.AttoparsecSystem.IO.Streams.ByteStringSystem.IO.Streams.ConcurrentSystem.IO.Streams.DebugSystem.IO.Streams.VectorSystem.IO.Streams.NetworkSystem.IO.Streams.ListSystem.IO.Streams.HandleSystem.IO.Streams.FileSystem.IO.Streams.CombinatorsSystem.IO.Streams.ProcessSystem.IO.Streams.TextSystem.IO.Streams.BuilderSystem.IO.Streams.ZlibSystem.IO.Streams.TutorialSystem.IO.StreamstoList%System.IO.Streams.Internal.AttoparsecfromList Data.Attoparsec.ByteString.Char8 takeWhileisDigitread endOfInputControl.Applicativepure skipWhileisSpacedecimal!System.IO.Streams.Internal.SearchSystem.IO.Streams.Core Data.Vector Control.Monad replicateMwritefreezeVector contramapstdout atEndOfInput atEndOfOutputlistOutputStreamconnectPreludefilter Data.List intersperse outputToListunlinespeekdrop connectTolineswordsunwordsData.ByteString.Char8Blaze.ByteString.BuilderflushData.ByteStringcopy(Blaze.ByteString.Builder.Internal.Buffer allocBufferConsumer Generator StreamPair OutputStream_write InputStream_read_unReadSPunReadsupplysupplyTomakeInputStreammakeOutputStreamlockingInputStreamlockingOutputStream nullInput nullOutputappendInputStreamconcatInputStreamsatEOFyield fromGeneratorawait fromConsumerParseExceptionparseFromStreamparserToInputStream MatchInfoNoMatchMatchsearch inputToChan chanToInput chanToOutputconcurrentMerge makeChanPipe debugInput debugInputBS debugOutput debugOutputBS fromVectortoVector toVectorSizedtoMutableVectortoMutableVectorSizedvectorOutputStreamvectorOutputStreamSizedmutableVectorOutputStreammutableVectorOutputStreamSizedoutputToMutableVectoroutputToMutableVectorSizedoutputToVectoroutputToVectorSized chunkVector writeVectorsocketToStreamssocketToStreamsWithBufferSize writeList chunkList concatListshandleToInputStreamhandleToOutputStreaminputStreamToHandleoutputStreamToHandlestreamPairToHandlestdinstderrwithFileAsInputwithFileAsInputStartingAtunsafeWithFileAsInputStartingAtwithFileAsOutputwithFileAsOutputExt outputFoldM inputFoldMfoldfoldManyallmaximumminimumunfoldMmapmapMmapM_ contramapM contramapM_ skipToEoffilterMzipzipWithzipWithM filterOutput filterOutputMunziptakegiveignore ignoreEofrunInteractiveCommandrunInteractiveProcess encodeUtf8 decodeUtf8decodeUtf8WithRateTooSlowExceptionReadTooShortExceptionTooManyBytesWrittenExceptionTooFewBytesWrittenExceptionTooManyBytesReadExceptionwriteLazyByteStringfromByteStringfromLazyByteString countInput countOutput takeBytessplitOnthrowIfProducesMoreThan readExactlytakeBytesWhile giveBytes giveExactlythrowIfConsumesMoreThanthrowIfTooSlow builderStreamunsafeBuilderStreambuilderStreamWithCompressionLevelgunzip decompress gzipBuildercompressBuilderdefaultCompressionLevelgzipcompressghc-prim GHC.TypesIOInttransformers-0.3.0.0Control.Monad.IO.ClassliftIObase Data.MaybeMaybeJustNothingGHC.Basereturnflip++unCunGbUFSIZ unsupported bufferToBSemptyWriteBuffer generatorBind$fApplicativeConsumer$fFunctorConsumer$fMonadIOConsumer$fMonadConsumer$fApplicativeGenerator$fFunctorGenerator$fMonadIOGenerator$fMonadGenerator $fIODeviceSP$fIODeviceInputStream$fIODeviceOutputStream$fBufferedIOSP$fBufferedIOInputStream$fBufferedIOOutputStream $fRawIOSP$fRawIOOutputStream$fRawIOInputStreamattoparsec-0.10.4.0#Data.Attoparsec.ByteString.InternalParserbytestring-0.10.0.2Data.ByteString.Internal ByteStringparseFromStreamInternal$fExceptionParseException$fShowParseExceptionmatchesControl.Concurrent.ChanChancondense Text.Readvector-0.10.9.1Data.Vector.Generic.BaseVectorFillInfo_vec_idx_szvfNewvfFinishvfAppenddEFAULT_BUFSIZnetwork-2.4.1.2Network.Socket.TypesSocketGHC.ListconcatGHC.IO.Handle.TypesHandleGHC.IO.Handle.FDfoldlTrueid System.IOputStrLnGHC.Showshowprocess-1.1.0.2System.ProcessprocgetProcessExitCodeinterruptProcessGroupOfterminateProcessshowCommandForUser rawSystemsystemreadProcessWithExitCode readProcesswaitForProcess createProcessshell runCommandSystem.Process.Internals ProcessHandle create_group close_fdsstd_errstd_outstd_incwdcmdspec CreateProcess ShellCommand RawCommandCmdSpecInherit UseHandle CreatePipe StdStream text-0.11.2.3Data.Text.InternalTextData.Text.EncodingData.Text.Encoding.Error OnDecodeError FindOutputNoCodesAreCompleteSplitLastCodeIsCompleteByteTypeStart ContinuationRegulardecodebetweencharacterizeBytefindLastFullCodegetTime modifyRef$fExceptionRateTooSlowException$fShowRateTooSlowException $fExceptionReadTooShortException$fShowReadTooShortException'$fExceptionTooManyBytesWrittenException"$fShowTooManyBytesWrittenException&$fExceptionTooFewBytesWrittenException!$fShowTooFewBytesWrittenException$$fExceptionTooManyBytesReadException$fShowTooManyBytesReadExceptionblaze-builder-0.3.1.1'Blaze.ByteString.Builder.Internal.TypesBuilderBufferAllocStrategyISDonePopperInputgzipBits compressBitsinflatedeflateBuilderdeflateclamp