5&c      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None9     None9    None9HMNClass of diverse types of .'Methods of this class are functions of s that are either basic functions to implement other ones, or have to preserve their packet/chunk structure for efficiency and strictness behaviour.!Minimum complete implementation: All but , , basicReplicate, % and  basicFromBits.(O(1) The empty .)(") = (U+2205, EMPTY SET*O(1) Convert a  into a .+O(n) Convert a [ ] into a .,O(n) Convert a  into a [].-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 -w. Most functions in this package are optimised to minimise frequency of memory allocations and copyings, but getting  s back from   requires the whole 5 to be constructed from scratch. Moreover, for lazy Cs this leads to be an incorrect strictness behaviour because lazy &s are represented as lists of strict  chunks but -J 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 9 is only strict on the chunk1' and will produce the following chunks: 9- 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: 5import 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 chunk2m. This means when you next time apply some functions strict on the first chunk, you end up fully evaluating chunk2 as well as chunk12 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 ./O(n) Convert a  into a .0O(n) Convert the lower n bits of the given 5. In the case that more bits are requested than the  provides, this acts as if the * has an infinite number of leading 0 bits.1O(n) Convert a  into a .2strict: O(n), lazy: O(1) 2 is an analogous to (: ) for lists.3O(n) For strict s, 3 is exactly the same as 2.For lazy ones, 3 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.4O(n) Append a bit to the end of a .5O(n) Append two s.6()) = 5U+29FA, DOUBLE PLUS7O(1)& Extract the first bit of a non-empty (. An exception will be thrown if empty.8strict: O(1), lazy: O(n)# Extract the last bit of a finite '. An exception will be thrown if empty.9O(1) Extract the bits after the 7 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(1) Test whether a  is empty.<strict: O(1), lazy: O(n) Return the length of a finite .=O(n) Map a function over a .>O(n) Reverse a .?O(n) ?g, applied to a binary operator, a starting value (typically the left-identity of the operator), and a , reduces the 0 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.AO(n) A is a variant of ?M that has no starting value argument, and thus must be applied to non-empty s.BO(n) A strict version of A.CO(n) Ch, applied to a binary operator, a starting value (typically the right-identity of the operator), and a , reduces the 0 using the binary operator, from right to left: C f z [x1, x2, ..., xn] == x1 f (x2 f ... (xn f z)...) DO(n) D is a variant of CM that has no starting value argument, and thus must be applied to non-empty s.EO(n) Concatenate all s in the list.FMap a function over a  and concatenate the results.GO(n) G returns the conjunction of a  list. For the result to be , the  must be finite; , however, results from a 2 value at a finite index of a finite or infinite . Note that strict s are always finite.HO(n) H returns the disjunction of a  list. For the result to be , the  must be finite; , however, results from a 2 value at a finite index of a finite or infinite . Note that strict s are always finite.IO(n) Applied to a predicate and a , I determines if any bit of the 0 satisfies the predicate. For the result to be , the  must be finite; , however, results from a U value for the predicate applied to a bit at a finite index of a finite or infinite .JO(n) Applied to a predicate and a , J determines if all bits of the . satisfy the predicate. For the result to be , the  must be finite; , however, results from a U value for the predicate applied to a bit at a finite index of a finite or infinite .KO(n) K is similar to ?, but returns a + of successive reduced bits from the left: K f z [x1, x2, ...] == [z, z f x1, (z f x1) f x2, ...]  Note that 8 (K f z xs) == ? f z xs LO(n) L is a variant of K& that has no starting value argument: L f [x1, x2, ...] == [x1, x1 f x2, ...] MO(n) M is the right-to-left dual of K . Note that 7 (M f z xs) == C f z xs NO(n) N is a variant of M& that has no starting value argument.OO(n) O n x is a  of length n with x the value of every bit.PO(n) The P function is a `dual' to C : while C reduces a  to a summary value, P builds a @ 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 b2 is used as the next element in a recursive call.QO(n) Q is a variant of P but constructs a  with at most n bits.RO(n) R n, applied to a  xs, returns the prefix of xs of length n, or xs itself if n > < xs.SO(n) S n xs returns the suffix of xs after the first n bits, or ( if n > < xs.TO(n) T, applied to a predicate p and a  xs', returns the longest prefix (possibly () of xs of bits that satisfy p.UO(n) U p xs% returns the suffix remaining after T p xs.VO(n) V, applied to a predicate p and a  xsD, 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 .V p xs is equivalent to (T p xs, U p xs)WO(n) W, applied to a predicate p and a  xsC, 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 .W p is equivalent to V (not . p).XO(n) X 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 x2 found at a finite index of a finite or infinite .Y(") = XU+2208, ELEMENT OFZ(" ) =  (")U+220B, CONTAINS AS MEMBER[O(n) [ is the negation of X.\(" ) = [U+2209, NOT AN ELEMENT OF](" ) =  (" )"U+220C, DOES NOT CONTAIN AS MEMBER^O(n) The ^" function takes a predicate and a  and returns the bit in the  matching the predicate, or  if there is no such bit._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 Cs of bits which do and do not satisfy the predicate, respectively.aO(n) - index (subscript) operator, starting from 0.bO(n) The b; 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.cO(n) The c function extends bT, by returning the indices of all bits equal to the query bit, in ascending order.dO(n) The d# function takes a predicate and a 0 and returns the index of the first bit in the  satisfying the predicate, or  if there is no such bit.eO(n) The e function extends dV, by returning the indices of all bits satisfying the predicate, in ascending order.f O(min(m, n)) f takes two ?s and returns a list of corresponding bit pairs. If one input & is short, excess bits of the longer  are discarded.gThe g function takes three /s and returns a list of triples, analogous to f.hThe hK function takes four lists and returns a list of quadruples, analogous to f.iThe i function takes five 3s and returns a list of five-tuples, analogous to f.jThe j function takes six 2s and returns a list of six-tuples, analogous to f.k O(min(m, n)) k generalises f[ by zipping with the function given as the first argument, instead of a tupling function.lThe lH function takes a function which combines three bits, as well as three Ds and returns a list of their point-wise combination, analogous to k.mThe mF function takes a function which combines four bits, as well as four Ds and returns a list of their point-wise combination, analogous to k.nThe nF function takes a function which combines five bits, as well as five Ds and returns a list of their point-wise combination, analogous to k.oThe oD function takes a function which combines six bits, as well as six Ds and returns a list of their point-wise combination, analogous to k.p O(min(m, n)) p( transforms a list of bit pairs into a  of first components and a  of second components.qThe q5 function takes a list of triples and returns three s, analogous to p.rThe r7 function takes a list of quadruples and returns four s, analogous to p.sThe s8 function takes a list of five-tuples and returns five s, analogous to p.tThe t6 function takes a list of six-tuples and returns six s, analogous to p.b !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstb !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstb !"#$%&'()*+,/01-.23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstN !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst 56XYZ[\]a None2349uu s are strict s having at most 8 bits.vva bitstreams interpret an octet as a vector of bits whose MSB comes first and LSB comes last e.g.B11110000 => [True, True , True , True, False, False, False, False]B10010100 => [True, False, False, True, False, True , False, False] operations (like 1 ) treat a v$ bitstream as a big-endian integer.wwa bitstreams interpret an octet as a vector of bits whose LSB comes first and MSB comes last e.g.B11110000 => [False, False, False, False, True, True , True , True]B10010100 => [False, False, True , False, True, False, False, True] operations (like 1 ) treat a w' bitstream as a little-endian integer.xO(1) x p ==  iff < p == 8, otherwise it returns .yO(1) Convert an octet to u.zO(1) z p converts a u p& to an octet, padding with zeroes if < p < 8.{O(1) Change the direction of u from w to v=. Bit directions only affect octet-based operations such as z.|O(1) Change the direction of u from v to w=. Bit directions only affect octet-based operations such as z.)uvwxyz{|uvwxyz{|wvuxyz{|(uvwxyz{|None39None 2349M}&A space-efficient representation of a 0 vector, supporting many efficient operations. }s have an idea of  directionsR controlling how octets are interpreted as bits. There are two types of concrete }s: } w and } v.~O(n) Convert a strict  into a strict }.O(n)  bits converts a strict } bits into a strict :. The resulting octets will be padded with zeroes if the < of bs is not multiple of 8.O(n) Convert a  of u s into a }.O(1) Convert a  of u s into a }, with provided overall bit length. The correctness of the bit length isn't checked, so you MUST be sure your bit length is absolutely correct.O(1) Convert a } into a  of us.O(1) Convert a } into a  of us.O(n) Convert a  of us into }.O(n) Convert a } w into a } v=. Bit directions only affect octet-based operations such as .O(n) Convert a } v into a } w=. Bit directions only affect octet-based operations such as .O(n) Read a }) from the stdin strictly, equivalent to  stdin. The . is closed after the contents have been read.O(n) Write a } to the stdout, equivalent to  stdout.The # function takes a function of type } d -> } dr as its argument. The entire input from the stdin is passed to this function as its argument, and the resulting } is output on the stdout.O(n)% Read an entire file strictly into a }.O(n) Write a } to a file.O(n) Append a } to a file.O(n)- Read entire handle contents strictly into a }.This function reads chunks at a time, doubling the chunksize on each read. The final buffer is then realloced to the appropriate size. For files > half of available memory, this may lead to memory exhaustion. Consider using  in this case.The K is closed once the contents have been read, or if an exception is thrown.O(n)  h n reads a } 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.CIf the handle is a pipe or socket, and the writing end is closed, # will behave as if EOF was reached.O(n) Like , except that a shorter }f may be returned if there are not enough octets immediately available to satisfy the whole request. N only blocks if there is no data available, and EOF has not yet been reached.O(n)  is similar to t, except that it will never block waiting for data to become available. If there is no data available to be read,  returns (.O(n) Write a } to the given .} forms # in the same way as ordinary lists:  = (  = 5  = E } s are lexicographically ordered. let x = + [ , ,  ] y = + [,  ,  ] z = + [ ] in [  x y -- GT ,  z y -- LT ] 7}~c()*+,-./012456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstvw}~c}wv()*+,~/01-.2456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst6}~None2349M&A space-efficient representation of a 0 vector, supporting many efficient operations. s have an idea of  directionsR controlling how octets are interpreted as bits. There are two types of concrete s:  w and  v.O(n)" Convert a list of chunks, strict }s, into a lazy .O(n) Convert a lazy  into a list of chunks, strict }s.O(n) Convert a lazy  into a lazy .O(n)  bits converts a lazy  bits into a lazy 6. The resulting octets will be padded with zeroes if bs is finite and its < is not multiple of 8.O(n) Convert a  w into a  v=. Bit directions only affect octet-based operations such as .O(n) Convert a  v into a  w=. Bit directions only affect octet-based operations such as .O(n)  f x returns an infinite  of repeated applications of f to x:  f x == [x, f x, f (f x), ...] O(n)  x is an infinite , with x the value of every bits.O(n)  ties a finite P into a circular one, or equivalently, the infinite repetition of the original ". It is the identity on infinite s.O(n)  is equivalent to  stdin . Will read lazily.O(n) Write a  to stdout, equivalent to  stdout.The # function takes a function of type  d ->  dy as its argument. The entire input from the stdin is lazily passed to this function as its argument, and the resulting  is output on the stdout.O(n)# Read an entire file lazily into a .O(n) Write a  to a file.O(n) Append a  to a file.O(n) Read entire handle contents lazily into a ;. Chunks are read on demand, using the default chunk size.Once EOF is encountered, the  is closed. h n reads a  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.CIf 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 will never block waiting for data to become available, instead it returns only whatever data is available.O(n) Write a  to the given . forms # in the same way as ordinary lists:  = (  = 5  = E  s are lexicographically ordered. let x = + [ , ,  ] y = + [,  ,  ] z = + [ ] in [  x y -- GT ,  z y -- LT ] <      !"#$%&'(c()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstvwcwv()*+,/01-.23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst:      !"#$%&'()          !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~}~u     bitstream-0.2.0.4Data.Bitstream.Fusion.MonadicData.Bitstream.FusionData.Bitstream.GenericData.Bitstream.PacketData.BitstreamData.Bitstream.LazyData.Bitstream.Internal genericLength genericTake genericDrop genericIndexgenericReplicategenericReplicateMgenericUnfoldrNgenericUnfoldrNMgenericFindIndexgenericFindIndexMgenericIndexed Bitstream basicStream basicUnstream basicCons basicCons' basicSnoc basicAppend basicTail basicInitbasicMap basicReverse basicConcat basicScanl basicTake basicDropbasicTakeWhilebasicDropWhile basicFilterbasicPartitionbasicFromNBits basicToBitsempty∅ singletonpackunpackstreamunstreamfromBits fromNBitstoBitsconscons'snocappend⧺headlasttailinitnulllengthmapreversefoldlfoldl'foldl1foldl1'foldrfoldr1concat concatMapandoranyallscanlscanl1scanrscanr1 replicateunfoldrunfoldrNtakedrop takeWhile dropWhilespanbreakelem∈∋notElem∉∌findfilter partition!! elemIndex elemIndices findIndex findIndiceszipzip3zip4zip5zip6zipWithzipWith3zipWith4zipWith5zipWith6unzipunzip3unzip4unzip5unzip6PacketRightLeftfull fromOctettoOctet packetLToR packetRToLfromByteString toByteString fromPacketsunsafeFromPackets toPackets streamPacketsunstreamPackets directionLToR directionRToL getContentsputBitsinteractreadFile writeFile appendFile hGetContentshGethGetSomehGetNonBlockinghPut fromChunkstoChunksiteraterepeatcycleghc-prim GHC.TypesBoolvector-0.10.12.2Data.Vector.Fusion.StreamStreambase Data.Bits FiniteBitsBitsTrueFalse Data.MaybeNothingJustGHC.Baseflip packetHeadL packetHeadR packetLastL packetLastR packetAndL packetAndR packetIndexL packetIndexRunsafePacketIndexLunsafePacketIndexR packetNull packetLengthpacketOremptyNotAllowedpacketOverflowindexOutOfRange unsafeConsL unsafeConsR unsafeSnocL unsafeSnocR reverseBits scanlPackettakeWhilePacketdropWhilePacket filterPacket$fBitstreamPacket$fBitstreamPacket0 $fOrdPacket $fOrdPacket0 $fShowPacket $fShowPacket0$fStorablePacket packPacketsnOctetslePacketsFromNBitsbePacketsFromNBitslePacketsToBitsbePacketsToBitsbytestring-0.10.4.0Data.ByteString.Internal ByteStringData.Vector.StorableVectorGHC.IO.Handle.TypesHandle$fMonoidBitstream Data.MonoidMonoidmemptymappendmconcat$fOrdBitstream GHC.Classescompare strictStreamstrictUnstream strictCons strictSnoc strictAppend strictTail strictInit strictMap strictReverse strictConcat strictScanl strictTake strictDropstrictTakeWhilestrictDropWhile strictFilter strictHead strictLast strictNull strictLength strictAndstrictOr strictIndex emptyStream unstreamBS countBits$fBitstreamBitstream$fBitstreamBitstream0 $fEqBitstream$fShowBitstreamData.ByteString.Lazy.InternalChunkEmpty chunkSize chunkBits lazyStream lazyUnstreamlazyCons lazyCons'lazySnoc lazyAppendlazyTaillazyInitlazyMap lazyReverse lazyConcat lazyScanllazyTakelazyDrop lazyTakeWhile lazyDropWhile lazyFilterlazyHeadlazyLastlazyNull lazyLengthlazyAndlazyOr lazyIndex streamChunksunstreamChunks packChunks unpackChunks