๚ฮ%ฒฬŒ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹         KClass of diverse types of . 'Methods of this class are functions of s that is either D basic functions to implement other ones, or have to preserve their  packet/9chunk structure for efficiency and strictness behaviour. !Minimum complete implementation: All but , ,    and &. O(n) Explicitly convert a  into a Œ of  . / operations are automatically fused whenever it's ? possible, safe, and effective to do so, but sometimes you may : find the rules are too conservative. These two functions   and % provide a means for coercive stream  fusion. #You should be careful when you use . Most functions in < this package are optimised to minimise frequency of memory ' allocations and copyings, but getting  s back from  Œ  requires the whole  to be . constructed from scratch. Moreover, for lazy s this < leads to be an incorrect strictness behaviour because lazy  %s are represented as lists of strict   chunks but  can't preserve the original chunk  structure. Let's say you have a lazy  with the  following chunks:   " bs = [chunk1, chunk2, chunk3, ...] 7and you want to drop the first bit of such stream. Our   is only strict on the chunk1 and will produce the following  chunks:     bs = [chunk0, chunk1', chunk2, chunk3, ...] where chunk0. is a singleton vector of the first packet of  chunk1! whose first bit is dropped, and chunk1' is a vector  of remaining packets of the chunk1 . Neither chunk2 nor  chunk30 have to be evaluated here as you might expect. *But think about the following expression:   6 import qualified Data.Vector.Fusion.Stream as Stream   $ Stream.tail $  bs 'the resulting chunk structure will be:    [chunk1', chunk2', chunk3', ...] <where each and every chunks are slightly different from the  original chunks, and this time chunk1' has the same length as  chunk1 but the last bit of chunk1' is from the first bit of  chunk25. This means when you next time apply some functions 8 strict on the first chunk, you end up fully evaluating chunk2  as well as chunk1, and this can be a serious misbehaviour for  lazy s. ?The automatic fusion rules are carefully designed to fire only  when there aren'-t any reason to preserve the original packet /  chunk structure. O(n) Convert a Œ of  into a . strict: O(n), lazy: O(1)  is an analogous to (:)  for lists. O(n) For strict s,  is exactly the same  as . For lazy ones,  is strict in the  we are ? consing onto. More precisely, it forces the first chunk to be ? evaluated. It does this because, for space efficiency, it may @ coalesce the new bit onto the first chunk rather than starting  a new chunk. O(n) Append a bit to the end of a . O(n) Append two s. O(1) Extract the bits after the 1 of a non-empty  (. An exception will be thrown if empty. O(n) Return all the bits of a  except the last , one. An exception will be thrown if empty. O(n) Map a function over a . O(n) Reverse a . O(n) Concatenate all s in the list. O(n)  is similar to =, but returns a  + of successive reduced bits from the left:     f z [x1, x2, ...] == [z, z f x1, (z f x1) f x2, ...]  Note that   2 ( f z xs) == = f z xs  O(n)   n x is a  of length n with  x the value of every bit. !O(n) ! n, applied to a  xs, returns the  prefix of xs of length n, or xs itself if n > 4  xs. "O(n) " n xs returns the suffix of xs after the  first n bits, or / if n > 4 xs. #O(n) #, applied to a predicate p and a   xs', returns the longest prefix (possibly /)  of xs of bits that satisfy p. $O(n) $ p xs$ returns the suffix remaining after  # p xs. %O(n) %, applied to a predicate and a ,  returns the  of those bits that satisfy the  predicate. &O(n) The &" function takes a predicate and a   and returns the pair of s of bits which 4 do and do not satisfy the predicate, respectively. '(") = / U+2205, EMPTY SET (()๚) =  U+29FA, DOUBLE PLUS )(") = H U+2208, ELEMENT OF *(" ) = Ž (") U+220B, CONTAINS AS MEMBER +(" ) = I U+2209, NOT AN ELEMENT OF ,(" ) = Ž (" ) #U+220C, DOES NOT CONTAIN AS MEMBER -O(n) Convert a [] into a . .O(n) Convert a  into a []. /O(1) The empty . 0O(1) Convert a  into a . 1O(1)& Extract the first bit of a non-empty . An $ exception will be thrown if empty. 2strict: O(1), lazy: O(n)" Extract the last bit of a finite  (. An exception will be thrown if empty. 3O(1) Test whether a  is empty. 4O(n) Retern the length of a finite . 5Map a function over a  and concatenate the results. 6O(n) 6 returns the conjunction of a  list. For the  result to be , the  must be finite; ,  however, results from a % value at a finite index of a finite  or infinite . Note that strict  s are always  finite. 7O(n) 7 returns the disjunction of a  list. For the  result to be , the  must be finite; ,  however, results from a % value at a finite index of a finite  or infinite . Note that strict  s are always  finite. 8O(n) Applied to a predicate and a , 8 determines  if any bit of the " satisfies the predicate. For the  result to be , the  must be finite; ,  however, results from a & value for the predicate applied to a / bit at a finite index of a finite or infinite . 9O(n) Applied to a predicate and a , 9 determines  if all bits of the  satisfy the predicate. For the  result to be , the  must be finite; ,  however, results from a $ value for the predicate applied to 1 a bit at a finite index of a finite or infinite . :O(n) : is a variant of  that has no starting  value argument:   : f [x1, x2, ...] == [x1, x1 f x2, ...] ;O(n) ; is the right-to-left dual of  . Note that   1 (; f z xs) == A f z xs <O(n) < is a variant of ; that has no starting  value argument. =O(n) =1, applied to a binary operator, a starting value 6 (typically the left-identity of the operator), and a ,  reduces the ) using the binary operator, from left to  right:    = f z [x1, x2, ..., xn] == (...((z f x1) f x2) f...) f xn The  must be finite. >O(n) > is a variant of = that is strict on the  accumulator. ?O(n) ? is a variant of = that has no starting 7 value argument, and thus must be applied to non-empty s. @O(n) A strict version of ?. AO(n) A1, applied to a binary operator, a starting value 7 (typically the right-identity of the operator), and a ,  reduces the * using the binary operator, from right to  left:   A f z [x1, x2, ..., xn] == x1 f (x2 f ... (xn f z)...) BO(n) B is a variant of A that has no starting 7 value argument, and thus must be applied to non-empty s. CO(n) The C function is a `dual' to A: while  A reduces a  to a summary value, C builds  a 7 from a seed value. The function takes the element and  returns ‘ if it is done producing the  or  returns ’ (a, b), in which case, a is a prepended to the   and b, is used as the next element in a recursive  call. DO(n) D is a variant of C but constructs a   with at most n bits. EO(n) . index (subscript) operator, starting from 0. FO(n) F, applied to a predicate p and a  xs, A returns a tuple where first element is longest prefix (possibly  /) of xs of bits that satisfy p and second element is the  remainder of the . F p xs is equivalent to (# p xs, $ p  xs) GO(n) G, applied to a predicate p and a   xs8, returns a tuple where first element is longest prefix  (possibly /) of xs of bits that do not satisfy p and ( second element is the remainder of the . G p is equivalent to F (not . p). HO(n) H is the  membership predicate, usually  written in infix form, e.g., x `elem` xs. For the result to be  , the  must be finite; , however, results  from an bit equal to x( found at a finite index of a finite or  infinite . IO(n) I is the negation of H. JO(n) The J" function takes a predicate and a   and returns the bit in the  matching the predicate, or  ‘ if there is no such bit. KO(n) The K) function returns the index of the first  bit in the given % which is equal to the query bit, or  ‘ if there is no such bit. LO(n) The L function extends K, by > returning the indices of all bits equal to the query bit, in  ascending order. MO(n) The M" function takes a predicate and a  / and returns the index of the first bit in the   satisfying the predicate, or ‘ if there is no  such bit. NO(n) The N function extends M, by @ returning the indices of all bits satisfying the predicate, in  ascending order. O O(min(m, n)) O takes two s and returns a list of ' corresponding bit pairs. If one input  is short, excess  bits of the longer  are discarded. PThe P function takes three s and returns a list  of triples, analogous to O. QThe Q1 function takes four lists and returns a list of  quadruples, analogous to O. RThe R function takes five s and returns a list of  five-tuples, analogous to O. SThe S function takes six s and returns a list of  six-tuples, analogous to O. T O(min(m, n)) T generalises O by zipping with the < function given as the first argument, instead of a tupling  function. UThe U0 function takes a function which combines three  bits, as well as three s and returns a list of their & point-wise combination, analogous to T. VThe V/ function takes a function which combines four  bits, as well as four s and returns a list of their & point-wise combination, analogous to T. WThe W/ function takes a function which combines five  bits, as well as five s and returns a list of their & point-wise combination, analogous to T. XThe X4 function takes a function which combines six bits,  as well as six )s and returns a list of their point-wise  combination, analogous to T. Y O(min(m, n)) Y' transforms a list of bit pairs into a   of first components and a  of second  components. ZThe Z4 function takes a list of triples and returns three  s, analogous to Y. [The [1 function takes a list of quadruples and returns  four s, analogous to Y. \The \2 function takes a list of five-tuples and returns  five s, analogous to Y. ]The ]5 function takes a list of six-tuples and returns six  s, analogous to Y. K !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]K !"#$%&-./012345=>?@AB6789CD:;<FGHIJEKLMNOPQRSTUVWXYZ[\]'()*+,K !"#$%& !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]"^^ s are strict s having at most 8 bits. “__9 bitstreams interpret an octet as a vector of bits whose ) MSB comes first and LSB comes last e.g. B 11110000 => [True, True , True , True, False, False, False, False] B 10010100 => [True, False, False, True, False, True , False, False] ``9 bitstreams interpret an octet as a vector of bits whose ) LSB comes first and MSB comes last e.g. B 11110000 => [False, False, False, False, True, True , True , True] B 10010100 => [False, False, True , False, True, False, False, True] ”•–—˜™š›œžŸ กขฃaO(1) a p ==  iff 4 p == 8, otherwise it  returns . bO(1) Convert an octet to ^. cO(1) c p converts a ^ p to an octet, padding  with zeroes if 4 p < 8. คฅฆงdO(1) Change the direction of ^ from ` to  _<. Bit directions only affect octet-based operations such as  c. eO(1) Change the direction of ^ from _ to  `<. Bit directions only affect octet-based operations such as  c. จฉชซฌ^_`abcde`_^abcde^_`abcdeญญญf&A space-efficient representation of a  vector, supporting  many efficient operations. fs have an idea of   directions7 controlling how octets are interpreted as bits. There  are two types of concrete fs: f ` and  f _. ฎฏฐฑฒณดตถทgO(n) Convert a strict ธ into a strict  f. hO(n) h bits converts a strict f bits  into a strict ธ&. The resulting octets will be padded  with zeroes if the 4 of bs is not multiple of 8. นiO(1) Convert a บ of ^ s into a f. jO(1) Convert a f into a บ of ^s. kO(n) Convert a f ` into a f  _<. Bit directions only affect octet-based operations such as  h. lO(n) Convert a f _ into a f  `<. Bit directions only affect octet-based operations such as  h. mO(n) Read a f( from the stdin strictly, equivalent to  s stdin. The ป is closed after the contents  have been read. nO(n) Write a f to the stdout, equivalent to w  stdout. oThe o# function takes a function of type f d  -> f d2 as its argument. The entire input from the stdin ? is passed to this function as its argument, and the resulting  f is output on the stdout. pO(n)% Read an entire file strictly into a f. qO(n) Write a f to a file. rO(n) Append a f to a file. sO(n)- Read entire handle contents strictly into a f. EThis function reads chunks at a time, doubling the chunksize on each G read. The final buffer is then realloced to the appropriate size. For G files > half of available memory, this may lead to memory exhaustion.  Consider using p in this case. The ป6 is closed once the contents have been read, or if an  exception is thrown. tO(n) t h n reads a f directly from the  specified ป h. First argument h is the ป to read  from, and the second n is the number of octets to read, not  bits$. It returns the octets read, up to n, or null if EOF has  been reached. BIf the handle is a pipe or socket, and the writing end is closed,  t$ will behave as if EOF was reached. uO(n) Like t, except that a shorter f may be B returned if there are not enough octets immediately available to  satisfy the whole request. u only blocks if there is no 3 data available, and EOF has not yet been reached. vO(n) v is similar to t, except that it D will never block waiting for data to become available. If there is  no data available to be read, v returns /. wO(n) Write a f to the given ป. ผf forms ฝ$ in the same way as ordinary lists:   พ = /  ฟ =   ภ =  มf!s are lexicographically ordered.   let x = - [ , , ]  y = - [,  , ]  z = - []  in  [ ย x y -- GT  , ย z y -- LT  ] ] !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_`fghijklmnopqrstuvw]f`_/'0-.ijghkl(1234=>?@AB56789:;< CD!"#$FGH)*I+,J%&EKLMNOPQRSTUVWXYZ[\]mnopqrstuvwfghijklmnopqrstuvw&x&A space-efficient representation of a  vector, supporting  many efficient operations. xs have an idea of   directions7 controlling how octets are interpreted as bits. There  are two types of concrete xs: x ` and  x _. รฤลฦวศษสหฬอฮฯyO(n)" Convert a list of chunks, strict f s, into a  lazy x. zO(n) Convert a lazy x into a list of chunks, strict  fs. {O(n) Convert a lazy ะ into a lazy x. |O(n) | bits converts a lazy x bits  into a lazy ะ&. The resulting octets will be padded  with zeroes if bs is finite and its 4 is not multiple of  8. ัาำ}O(n) Convert a x ` into a x  _<. Bit directions only affect octet-based operations such as  |. ~O(n) Convert a x _ into a x  `<. Bit directions only affect octet-based operations such as  |. O(n)  f x returns an infinite x of  repeated applications of f to x:    f x == [x, f x, f (f x), ...] €O(n) € x is an infinite x, with x the  value of every bits. O(n)  ties a finite x into a circular one, or 7 equivalently, the infinite repetition of the original x.  It is the identity on infinite xs. ‚O(n) ‚ is equivalent to ˆ  stdin . Will read lazily. ƒO(n) Write a x to stdout, equivalent to ‹  stdout. „The „# function takes a function of type x d  -> x d2 as its argument. The entire input from the stdin < is lazily passed to this function as its argument, and the  resulting x is output on the stdout. …O(n)# Read an entire file lazily into a x. †O(n) Write a x to a file. ‡O(n) Append a x to a file. ˆO(n) Read entire handle contents lazily into a  x5. Chunks are read on demand, using the default chunk  size. Once EOF is encountered, the ป is closed. ‰‰ h n reads a x directly from the specified  ป h. First argument h is the ป to read from, and  the second n is the number of octets to read, not bits. It  returns the octets read, up to n, or null if EOF has been  reached. BIf the handle is a pipe or socket, and the writing end is closed,  ‰$ will behave as if EOF was reached. ŠO(n) Š is similar to ‰, except that it C will never block waiting for data to become available, instead it * returns only whatever data is available. ‹O(n) Write a x to the given ป. ิx forms ฝ$ in the same way as ordinary lists:   พ = /  ฟ =   ภ =  ีx!s are lexicographically ordered.   let x = - [ , , ]  y = - [,  , ]  z = - []  in  [ ย x y -- GT  , ย z y -- LT  ] ` !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_`xyz{|}~€‚ƒ„…†‡ˆ‰Š‹`x`_/'0-.yz{|}~(1234=>?@AB56789:;<€ CD!"#$FGH)*I+,J%&EKLMNOPQRSTUVWXYZ[\]‚ƒ„…†‡ˆ‰Š‹xyz{|}~€‚ƒ„…†‡ˆ‰Š‹ึ          !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxfgjkyz{lmnopqrsuv|}~€‚ƒ„€…€†‚‡ˆ‚‡‰^Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซ™ฌญฎฏ|ฐฑ‚ฒณด‚ตถ‚ตท‚ตธ‚ตนบ‚ปผฝพฟภมยรฤลฦวซ™ฌศฎษสหดบฬ bitstream-0.1Data.Bitstream.Fusion.MonadicData.Bitstream.FusionData.Bitstream.GenericData.Bitstream.PacketData.BitstreamData.Bitstream.LazyData.Bitstream.Internal genericLength genericTake genericDrop genericIndexgenericReplicategenericReplicateMgenericUnfoldrNgenericUnfoldrNMgenericFindIndexgenericFindIndexMgenericIndexed Bitstreamstreamunstreamconscons'snocappendtailinitmapreverseconcatscanl replicatetakedrop takeWhile dropWhilefilter partitionโˆ…โงบโˆˆโˆ‹โˆ‰โˆŒpackunpackempty singletonheadlastnulllength concatMapandoranyallscanl1scanrscanr1foldlfoldl'foldl1foldl1'foldrfoldr1unfoldrunfoldrN!!spanbreakelemnotElemfind elemIndex elemIndices findIndex findIndiceszipzip3zip4zip5zip6zipWithzipWith3zipWith4zipWith5zipWith6unzipunzip3unzip4unzip5unzip6PacketRightLeftfull fromOctettoOctet packetLToR packetRToLfromByteString toByteString fromPackets toPackets directionLToR directionRToL getContentsputBitsinteractreadFile writeFile appendFile hGetContentshGethGetSomehGetNonBlockinghPut fromChunkstoChunksiteraterepeatcyclevector-0.7.0.1Data.Vector.Fusion.StreamStreamghc-primGHC.BoolBoolbaseGHC.BaseflipTrueFalse Data.MaybeNothingJust packetHeadL packetHeadR packetLastL packetLastR packetAndL packetAndR packetIndexL packetIndexRunsafePacketIndexLunsafePacketIndexR packetNull packetLengthpacketOremptyNotAllowedpacketOverflowindexOutOfRange unsafeConsL unsafeConsR unsafeSnocL unsafeSnocR reverseBits scanlPackettakeWhilePacketdropWhilePacket filterPacket packPackets strictHead strictLast strictNull strictLength strictAndstrictOr strictIndex emptyStreambytestring-0.9.1.8Data.ByteString.Internal ByteString unstreamBSData.Vector.StorableVectorGHC.IO.Handle.TypesHandle$fMonoidBitstream Data.MonoidMonoidmemptymappendmconcat$fOrdBitstream GHC.ClassescompareChunkEmpty chunkSize chunkBitslazyHeadlazyLastlazyNull lazyLengthlazyAndlazyOr lazyIndexData.ByteString.Lazy.Internal streamChunksunstreamChunks packChunks