e?      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ NoneRight-shift of a . Right-shift of a . Right-shift of a . Right-shift of a . 6Select an implementation depending on the bit-size of s. G Currently, it produces a runtime failure if the bitsize is different. $ This is detected by the testsuite.  GHCunstable, private Simon Meier <iridcode@gmail.com>NoneOA builder primitive that always results in sequence of bytes that is no longer  than a pre-determined bound. DA builder primitive that always results in a sequence of bytes of a  pre-determined, fixed size. 1The type used for sizes and sizeBounds of sizes. 7Type-constructors supporting lifting of type-products. !Contravariant functors as in the  contravariant package. JA fmap-like operator for builder primitives, both bounded and fixed size. *Builder primitives are contravariant so it's like the normal fmap, but M backwards (look at the type). (If it helps to remember, the operator symbol  is like ( $) but backwards.) (We can use it for example to prepend and/or append fixed values to an  primitive.  @showEncoding ((\x -> ('\'', (x, '\''))) >$< fixed3) 'x' = "'x'"  where ' fixed3 = char7 >*< char7 >*< char7 CNote that the rather verbose syntax for composition stems from the , requirement to be able to compute the size / size bound at compile time.  A pairing/@concatenation operator for builder primitives, both bounded and  fixed size.  For example,  A toLazyByteString (primFixed (char7 >*< char7) ('x','y')) = "xy" )We can combine multiple primitives using  multiple times. R toLazyByteString (primFixed (char7 >*< char7 >*< char7) ('x',('y','z'))) = "xyz" 5The size of the sequences of bytes generated by this . The 2 that always results in the zero-length sequence. MEncode a pair by encoding its first component and then its second component. GChange a primitives such that it first applies a function to the value  to be encoded. Note that primitives are Contrafunctors   0http://hackage.haskell.org/package/contravariant. Hence, the following  laws hold. contramapF id = id 1contramapF f . contramapF g = contramapF (g . f)  Convert a  to a . Lift a  to a . >The bound on the size of sequences of bytes generated by this .  Change a . such that it first applies a function to the  value to be encoded.  Note that s are Contrafunctors   0http://hackage.haskell.org/package/contravariant. Hence, the following  laws hold. contramapB id = id 1contramapB f . contramapB g = contramapB (g . f) The 2 that always results in the zero-length sequence. MEncode a pair by encoding its first component and then its second component.  Encode an   value using the first  for    values and the second  for   values. Note that the functions , , and  (written below  using ) suffice to construct s for all non-recursive # algebraic datatypes. For example,  CmaybeB :: BoundedPrim () -> BoundedPrim a -> BoundedPrim (Maybe a) maybeB nothing just =   (Left ()) Right  eitherB nothing just Conditionally select a . N For example, we can implement the ASCII primitive that drops characters with * Unicode codepoints above 127 as follows.  charASCIIDrop =  (< '\128') (fromF char7)      GHC experimental Simon Meier <iridcode@gmail.com>None Encode a  using a  encoding.  PRE: The 0 encoding must have a size of at least 4 bytes.  Encode a  using a  encoding.  PRE: The 0 encoding must have a size of at least 8 bytes.  GHC Simon Meier <iridcode@gmail.com>None &Encoding single unsigned bytes as-is.  Encoding s in big endian format.  Encoding s in little endian format.  Encoding s in big endian format.  Encoding s in little endian format.  Encoding s in big endian format.  Encoding s in little endian format. Encode a single native machine . The s is encoded in host order, G host endian form, for the machine you are on. On a 64 bit machine the  K is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way F are not portable to different endian or word sized machines, without  conversion.  Encoding ,s in native host order and host endianness.  Encoding ,s in native host order and host endianness.  Encoding ,s in native host order and host endianness. $Encoding single signed bytes as-is.  Encoding s in big endian format.  Encoding s in little endian format.  Encoding s in big endian format.  Encoding s in little endian format.  Encoding  s in big endian format.  Encoding  s in little endian format. Encode a single native machine !. The !s is encoded in host order, G host endian form, for the machine you are on. On a 64 bit machine the ! K is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way I are not portable to different endian or integer sized machines, without  conversion.  Encoding ,s in native host order and host endianness.  Encoding ,s in native host order and host endianness.  Encoding  ,s in native host order and host endianness.  Encode a  in big endian format.  Encode a  in little endian format. ! Encode a  in big endian format. " Encode a  in little endian format. # Encode a : in native host order and host endianness. Values written M this way are not portable to different endian machines, without conversion. $ Encode a + in native host order and host endianness.   !"#$  !"#$  !"#$  non-portableunstable.dons00@gmail.com, duncan@community.haskell.orgNone%DA space-efficient representation of a Word8 vector, supporting many  efficient operations. A %! contains 8-bit characters only. 1Instances of Eq, Ord, Read, Show, Data, Typeable "6The 0 pointer. Used to indicate the empty Bytestring. #O(1)' Build a ByteString from a ForeignPtr. DIf you do not need the offset parameter then you do should be using   or   instead. $O(1), Deconstruct a ForeignPtr from a ByteString %8A way of creating ByteStrings outside the IO monad. The Int 2 argument gives the final size of the ByteString. &Like %- but instead of giving the final size of the A ByteString, it is just an upper bound. The inner action returns  the actual size. Unlike ' the ByteString is not @ reallocated if the final size is less than the estimated size. (Create ByteString of size l and use action f to fill it' s contents. )%Create ByteString of up to size size l and use action f to fill it's ' contents which returns its true size. * Create ByteString of up to size l and use action f to fill it'(s contents which returns its true size. 'BGiven the maximum size needed and a function to make the contents * of a ByteString, createAndTrim makes the %. The generating 7 function is required to return the actual final size (<= the maximum @ size), and the resulting byte array is realloced to this size. CcreateAndTrim is the main mechanism for creating custom, efficient G ByteString functions, using Haskell or C functions to fill the space. + Wrapper of mallocForeignPtrBytes$ with faster implementation for GHC , still needed -Conversion between . and /. Should compile to a no-op. 0Unsafe conversion between / and .. This is a no-op and & silently truncates to 8 bits Chars > '\255'. It is provided as * convenience for ByteString construction. 1KSelects words corresponding to white-space characters in the Latin-1 range  ordered by frequency. 24Selects white-space characters in the Latin-1 range 3FJust like unsafePerformIO, but we inline it. Big performance gains as 0 it exposes lots of things to further inlining.  Very unsafe. In : particular, you should do no memory allocation inside an  3 block. On Hugs this is just unsafePerformIO. :%456789:;<=>?@ABCDEFGHIJK"#Offset Length $(ptr, offset, length) %&L()*'M+,NOP-0123QRSTUVWXYZ[\(%456789>?@ABCDEFGHIJK"#$%&()'M+-0123QRST9%456789:;<=>?@ABCDEFGHIJK"#$%&L()*'M+,NOP-0123QRSTUVWXYZ[\ non-portable provisional.dons00@gmail.com, duncan@community.haskell.orgNone& A variety of ] for non-empty ByteStrings. & omits the G check for the empty case, so there is an obligation on the programmer 6 to provide a proof that the ByteString is non-empty. ' A variety of ^ for non-empty ByteStrings. ' omits the # check for the empty case. As with &, the programmer must < provide a separate proof that the ByteString is non-empty. ( A variety of _ for non-empty ByteStrings. ( omits the # check for the empty case. As with &, the programmer must < provide a separate proof that the ByteString is non-empty. ) A variety of ` for non-empty ByteStrings. ) omits the # check for the empty case. As with &, the programmer must < provide a separate proof that the ByteString is non-empty. *Unsafe %: index (subscript) operator, starting from 0, returning a . C This omits the bounds check, which means there is an accompanying G obligation on the programmer to ensure the bounds are checked in some  other way. + A variety of a which omits the checks on n so there is an 6 obligation on the programmer to provide a proof that 0 <= n <= b xs. , A variety of c which omits the checks on n so there is an 6 obligation on the programmer to provide a proof that 0 <= n <= b xs. -O(n)< Pack a null-terminated sequence of bytes, pointed to by an  Addr#< (an arbitrary machine address assumed to point outside the  garbage-collected heap) into a  ByteString. A much faster way to  create an Addr#3 is with an unboxed string literal, than to pack a @ boxed string. A unboxed string literal is compiled to a static char  []B by GHC. Establishing the length of the string requires a call to   strlen(3) , so the Addr#, must point to a null-terminated buffer (as  is the case with string# literals in GHC). Use . 2 if you know the length of the string statically.  An example:  * literalFS = unsafePackAddress "literal"# This function is unsafe-. If you modify the buffer pointed to by the  original Addr#6 this modification will be reflected in the resulting   ByteString%, breaking referential transparency. Note this also won't work if you Add# has embedded '\0' characters in  the string (strlen will fail). .O(1) .( provides constant-time construction of   ByteStrings9 which is ideal for string literals. It packs a sequence  of bytes into a %, given a raw d to the string, and  the length of the string. This function is unsafe in two ways: = the length argument is assumed to be correct. If the length B argument is incorrect, it is possible to overstep the end of the  byte array.  if the underying Addr#( is later modified, this change will be  reflected in resulting  ByteString, breaking referential  transparency. If in doubt, don't use these functions. /O(1) Construct a %" given a Ptr Word8 to a buffer, a E length, and an IO action representing a finalizer. This function is  not available on Hugs. This function is unsafe&, it is possible to break referential C transparency by modifying the underlying buffer pointed to by the F first argument. Any changes to the original buffer will be reflected  in the resulting  ByteString. 0/Explicitly run the finaliser associated with a %. I References to this value after finalisation may generate invalid memory  references. This function is unsafe, as there may be other   ByteStrings4 referring to the same underlying pages. If you use 6 this, you need to have a proof of some kind that all %s C ever generated from the underlying byte array are no longer live. 1O(n) Build a  ByteString from a CString. This value will have no B finalizer associated to it, and will not be garbage collected by 4 Haskell. The ByteString length is calculated using  strlen(3),  and thus the complexity is a O(n). This function is unsafe . If the CString is later modified, this + change will be reflected in the resulting  ByteString , breaking  referential transparency. 2O(1) Build a  ByteString from a  CStringLen. This value will  have no7 finalizer associated with it, and will not be garbage * collected by Haskell. This operation has O(1) complexity as we $ already know the final size, so no  strlen(3) is required. This funtion is unsafe. If the original  CStringLen is later : modified, this change will be reflected in the resulting  ByteString, $ breaking referential transparency. 3O(n) Build a  ByteString from a malloced CString. This value will  have a free(3) finalizer associated to it. This funtion is unsafe. If the original CString is later : modified, this change will be reflected in the resulting  ByteString, $ breaking referential transparency. >This function is also unsafe if you call its finalizer twice,  which will result in a  double free error, or if you pass it  a CString not allocated with malloc. 4O(n) Build a  ByteString from a malloced  CStringLen. This  value will have a free(3) finalizer associated to it. This funtion is unsafe. If the original CString is later : modified, this change will be reflected in the resulting  ByteString, $ breaking referential transparency. >This function is also unsafe if you call its finalizer twice,  which will result in a  double free error, or if you pass it  a CString not allocated with malloc. 5O(1) construction Use a  ByteString with a function requiring a  CString. 6This function does zero copying, and merely unwraps a  ByteString to  appear as a CString. It is unsafe in two ways: ! After calling this function the CString shares the underlying  byte buffer with the original  ByteString. Thus modifying the  CString=, either in C, or using poke, will cause the contents of the   ByteString5 to change, breaking referential transparency. Other   ByteStrings0 created by sharing (such as those produced via a  or c1) will also reflect these changes. Modifying the CString 9 will break referential transparency. To avoid this, use   useAsCString%, which makes a copy of the original  ByteString.  CStrings7 are often passed to functions that require them to be " null-terminated. If the original  ByteString wasn't null terminated,  neither will the CString* be. It is the programmers responsibility  to guarantee that the  ByteString" is indeed null terminated. If in  doubt, use  useAsCString. 6O(1) construction Use a  ByteString with a function requiring a   CStringLen. 6This function does zero copying, and merely unwraps a  ByteString to  appear as a  CStringLen. It is unsafe: ! After calling this function the  CStringLen shares the underlying  byte buffer with the original  ByteString. Thus modifying the   CStringLen=, either in C, or using poke, will cause the contents of the   ByteString5 to change, breaking referential transparency. Other   ByteStrings0 created by sharing (such as those produced via a  or c1) will also reflect these changes. Modifying the  CStringLen 9 will break referential transparency. To avoid this, use  useAsCStringLen%, which makes a copy of the original  ByteString. &'()*+,-./0123456&'()*+,-./0123456&'()*+,561234-./0&'()*+,-./0123456portablestable.dons00@gmail.com, duncan@community.haskell.org Trustworthyl7O(1) The empty % 8O(1) Convert a . into a % 9O(n) Convert a '[Word8]' into a %. FFor applications with large numbers of string literals, pack can be a C bottleneck. In such cases, consider using packAddress (GHC only). :O(n) Converts a % to a '[Word8]'. ;O(1)% Test whether a ByteString is empty. <O(1) <* returns the length of a ByteString as an !. =O(n) =1 is analogous to (:) for lists, but of different & complexity, as it requires a memcpy. >O(n) Append a byte to the end of a % ?O(1)E Extract the first element of a ByteString, which must be non-empty. A An exception will be thrown in the case of an empty ByteString. @O(1)O Extract the elements after the head of a ByteString, which must be non-empty. A An exception will be thrown in the case of an empty ByteString. AO(1)> Extract the head and tail of a ByteString, returning Nothing  if it is empty. BO(1)O Extract the last element of a ByteString, which must be finite and non-empty. A An exception will be thrown in the case of an empty ByteString. CO(1) Return all the elements of a % except the last one. A An exception will be thrown in the case of an empty ByteString. DO(1) Extract the C and B$ of a ByteString, returning Nothing  if it is empty. EO(n) Append two ByteStrings FO(n) F f xs( is the ByteString obtained by applying f to each  element of xs,. This function is subject to array fusion. GO(n) G xs% efficiently returns the elements of xs in reverse order. HO(n) The H function takes a . and a  % and ` intersperses'# that byte between the elements of  the %2. It is analogous to the intersperse function on  Lists. IThe I1 function transposes the rows and columns of its  % argument. JJ<, applied to a binary operator, a starting value (typically C the left-identity of the operator), and a ByteString, reduces the ; ByteString using the binary operator, from left to right. *This function is subject to array fusion. K 'foldl\'' is like J!, but strict in the accumulator. I However, for ByteStrings, all left folds are strict in the accumulator. LL1, applied to a binary operator, a starting value C (typically the right-identity of the operator), and a ByteString, G reduces the ByteString using the binary operator, from right to left. M 'foldr\'' is like L!, but strict in the accumulator. NN is a variant of J that has no starting value 1 argument, and thus must be applied to non-empty  ByteStrings. , This function is subject to array fusion. A An exception will be thrown in the case of an empty ByteString. O 'foldl1\'' is like N!, but strict in the accumulator. A An exception will be thrown in the case of an empty ByteString. PP is a variant of L& that has no starting value argument, ' and thus must be applied to non-empty %s A An exception will be thrown in the case of an empty ByteString. Q 'foldr1\'' is a variant of P, but is strict in the  accumulator. RO(n)$ Concatenate a list of ByteStrings. SMap a function over a % and concatenate the results TO(n)* Applied to a predicate and a ByteString, T determines if  any element of the % satisfies the predicate. UO(n) Applied to a predicate and a %, U determines  if all elements of the % satisfy the predicate. VO(n) V" returns the maximum value from a %  This function will fuse. A An exception will be thrown in the case of an empty ByteString. WO(n) W" returns the minimum value from a %  This function will fuse. A An exception will be thrown in the case of an empty ByteString. XThe X( function behaves like a combination of F and  J9; it applies a function to each element of a ByteString, G passing an accumulating parameter from left to right, and returning a = final value of this accumulator together with the new list. YThe Y( function behaves like a combination of F and  L9; it applies a function to each element of a ByteString, G passing an accumulating parameter from right to left, and returning a C final value of this accumulator together with the new ByteString. ZZ is similar to J#, but returns a list of successive 8 reduced values from the left. This function will fuse.  B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs. [[ is a variant of Z& that has no starting value argument.  This function will fuse. 0 scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] \*scanr is the right-to-left dual of scanl. ]] is a variant of \& that has no starting value argument. ^O(n) ^ n x is a ByteString of length n with x 2 the value of every element. The following holds:  0 replicate w c = unfoldr w (\u -> Just (u,u)) c This implemenation uses  memset(3) _O(n), where n# is the length of the result. The _ # function is analogous to the List 'unfoldr'. _ builds a D ByteString from a seed value. The function takes the element and  returns e4 if it is done producing the ByteString or returns  f (a,b), in which case, a" is the next byte in the string,  and b+ is the seed value for further production.  Examples: B unfoldr (\x -> if x <= 5 then Just (x, x + 1) else Nothing) 0  == pack [0, 1, 2, 3, 4, 5] `O(n) Like _, `! builds a ByteString from a seed C value. However, the length of the result is limited by the first  argument to `(. This function is more efficient than _ 1 when the maximum length of the result is known. The following equation relates ` and _: . fst (unfoldrN n f s) == take n (unfoldr f s) aO(1) a n, applied to a ByteString xs, returns the prefix  of xs of length n, or xs itself if n > < xs. bO(1) b n xs returns the suffix of xs after the first n  elements, or [] if n > < xs. cO(1) c n xs is equivalent to (a n xs, b n xs). dd, applied to a predicate p and a ByteString xs, 0 returns the longest prefix (possibly empty) of xs of elements that  satisfy p. ee p xs$ returns the suffix remaining after d p xs. ff p is equivalent to i (g . p). ;Under GHC, a rewrite rule will transform break (==) into a $ call to the specialised breakByte:  break ((==) x) = breakByte x  break (==x) = breakByte x gg7 breaks its ByteString argument at the first occurence 2 of the specified byte. It is more efficient than f as it is  implemented with  memchr(3). I.e. . break (=='c') "abcd" == breakByte 'c' "abcd" hh behaves like f but from the end of the % breakEnd p == spanEnd (not.p) ii p xs0 breaks the ByteString into two segments. It is  equivalent to (d p xs, e p xs) hh- breaks its ByteString argument at the first C occurence of a byte other than its argument. It is more efficient  than ' span (==)' - span (=='c') "abcd" == spanByte 'c' "abcd" jj behaves like i but from the end of the %.  We have  / spanEnd (not.isSpace) "x y z" == ("x y ","z") and  spanEnd (not . isSpace) ps  == H let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x) kO(n) Splits a % into components delimited by G separators, where the predicate returns True for a separator element. G The resulting components do not contain the separators. Two adjacent = separators result in an empty component in the output. eg. 4 splitWith (=='a') "aabbaca" == ["","","bb","c",""] # splitWith (=='a') [] == [] lO(n) Break a %# into pieces separated by the byte ) argument, consuming the delimiter. I.e.  . split '\n' "a\nb\nd\ne" == ["a","b","d","e"] 0 split 'a' "aXaXaXa" == ["","X","X","X",""] $ split 'x' "x" == ["",""] and  ! intercalate [c] . split c == id  split == splitWith . (==) CAs for all splitting functions in this library, this function does 1 not copy the substrings, it just constructs new  ByteStrings that  are slices of the original. mThe m3 function takes a ByteString and returns a list of G ByteStrings such that the concatenation of the result is equal to the E argument. Moreover, each sublist in the result contains only equal  elements. For example,  < group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"] It is a special case of n!, which allows the programmer to > supply their own equality test. It is about 40% faster than   groupBy (==) nThe n+ function is the non-overloaded version of m. oO(n) The o function takes a % and a list of  %:s and concatenates the list after interspersing the first , argument between each element of the list. iO(n)B intercalateWithByte. An efficient way to join to two ByteStrings ? with a char. Around 4 times faster than the generalised join. pO(1) %. index (subscript) operator, starting from 0. qO(n) The q) function returns the index of the first  element in the given % which is equal to the query  element, or e if there is no such element. % This implementation uses memchr(3). rO(n) The r( function returns the last index of the  element in the given % which is equal to the query  element, or e, if there is no such element. The following  holds:  elemIndexEnd c xs == 5 (-) (length xs - 1) `fmap` elemIndex c (reverse xs) sO(n) The s function extends q, by returning M the indices of all elements equal to the query element, in ascending order. % This implementation uses memchr(3). tIcount returns the number of times its argument appears in the ByteString   count = length . elemIndices ABut more efficiently than using length on the intermediate list. uThe u" function takes a predicate and a % and : returns the index of the first element in the ByteString  satisfying the predicate. vThe v function extends u, by returning the G indices of all elements satisfying the predicate, in ascending order. wO(n) w is the % membership predicate. xO(n) x is the inverse of w yO(n) y+, applied to a predicate and a ByteString, C returns a ByteString containing those characters that satisfy the 6 predicate. This function is subject to array fusion. zO(n) The z. function takes a predicate and a ByteString, = and returns the first element in matching the predicate, or e  if there is no such element. H find f p = case findIndex f p of Just n -> Just (p ! n) ; _ -> Nothing {O(n) The {5 function takes a predicate a ByteString and returns G the pair of ByteStrings with elements which do and do not satisfy the  predicate, respectively; i.e., 6 partition p bs == (filter p xs, filter (not . p) xs) |O(n) The |, function takes two ByteStrings and returns j * iff the first is a prefix of the second. }O(n) The }, function takes two ByteStrings and returns j * iff the first is a suffix of the second. The following holds:  4 isSuffixOf x y == reverse x `isPrefixOf` reverse y FHowever, the real implemenation uses memcmp to compare the end of the ) string only, with no reverse required.. ~4Check whether one string is a substring of another.  isInfixOf  p s is equivalent to not (null (findSubstrings p s)). CBreak a string on a substring, returning a pair of the part of the 8 string prior to the match, and the rest of the string. "The following relationships hold:  2 break (== c) l == breakSubstring (singleton c) l and:   findSubstring s l ==  if null s then Just 0 . else case breakSubstring s l of 4 (x,y) | null y -> Nothing < | otherwise -> Just (length x) 8For example, to tokenise a string, dropping delimiters:  J tokenise x y = h : if null t then [] else tokenise x (drop (length x) t) & where (h,t) = breakSubstring x y ,To skip to the first occurence of a string:   snd (breakSubstring x y) 2To take the parts of a string before a delimiter:  fst (breakSubstring x y) 6Get the first index of a substring in another string,  or e if the string is not found.  findSubstring p s is equivalent to  listToMaybe (findSubstrings p s). ?Find the indexes of all (possibly overlapping) occurances of a  substring in a string. O(n) - takes two ByteStrings and returns a list of A corresponding pairs of bytes. If one input ByteString is short, A excess elements of the longer ByteString are discarded. This is  equivalent to a pair of : operations.  generalises ' by zipping with the function given as B the first argument, instead of a tupling function. For example,   (+)6 is applied to two ByteStrings to produce the list of  corresponding sums. k:A specialised version of zipWith for the common case of a F simultaneous map over two bytestrings, to build a 3rd. Rewrite rules 6 are used to automatically covert zipWith into zipWith' when a pack is % performed on the result of zipWith. O(n) 4 transforms a list of pairs of bytes into a pair of * ByteStrings. Note that this performs two 9 operations. O(n)* Return all initial segments of the given %, shortest first. O(n)( Return all final segments of the given %, longest first. O(n)5 Sort a ByteString efficiently, using counting sort. O(n) construction Use a  ByteString with a function requiring a  null-terminated CString. The CString will be freed % automatically. This is a memcpy(3). O(n) construction Use a  ByteString with a function requiring a  CStringLen.  As for  useAsCString, this function makes a copy of the original  ByteString. O(n). Construct a new  ByteString from a CString. The  resulting  ByteString& is an immutable copy of the original  CString3, and is managed on the Haskell heap. The original  CString must be null terminated. O(n). Construct a new  ByteString from a  CStringLen. The  resulting  ByteString& is an immutable copy of the original  CStringLen.  The  ByteString6 is a normal Haskell value and will be managed on the  Haskell heap. O(n) Make a copy of the % with its own storage. = This is mainly useful to allow the rest of the data pointed  to by the %& to be garbage collected, for example B if a large string has been read in, and only a small part of it ' is needed in the rest of the program. Read a line from stdin. Read a line from a handle  Outputs a % to the specified l.  Similar to 5 except that it will never block. Instead it returns 5 any tail that did not get written. This tail may be 7 in the case that K the whole string was written, or the whole original string if nothing was , written. Partial writes are also possible. FNote: on Windows and with Haskell implementation other than GHC, this = function does not work correctly; it behaves identically to . A synonym for hPut, for compatibility 9Write a ByteString to a handle, appending a newline byte Write a ByteString to stdout 7Write a ByteString to stdout, appending a newline byte Read a % directly from the specified l. This : is far more efficient than reading the characters into a m  and then using 9.. First argument is the Handle to read from, E and the second is the number of bytes to read. It returns the bytes  read, up to n, or ; if EOF has been reached.  is implemented in terms of n. 7If the handle is a pipe or socket, and the writing end  is closed, $ will behave as if EOF was reached. hGetNonBlocking is similar to ", except that it will never block M waiting for data to become available, instead it returns only whatever data : is available. If there is no data available to be read,   returns 7. FNote: on Windows and with Haskell implementation other than GHC, this = function does not work correctly; it behaves identically to . Like , except that a shorter % may be returned D if there are not enough bytes immediately available to satisfy the  whole request. ! only blocks if there is no data . available, and EOF has not yet been reached. ,Read entire handle contents strictly into a %. 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  in this case. As with 6, the string representation in the file is assumed to  be ISO-8859-1. 7The Handle is closed once the contents have been read,  or if an exception is thrown. CgetContents. Read stdin strictly. Equivalent to hGetContents stdin  The l. is closed after the contents have been read. /The interact function takes a function of type ByteString -> ByteString L as its argument. The entire input from the standard input device is passed M to this function as its argument, and the resulting string is output on the  standard output device. $Read an entire file strictly into a %. This is far more . efficient than reading the characters into a m and then using  9;. It also may be more efficient than opening the file and  reading it using . Write a % to a file.  Append a % to a file. oo4 is a variant of findIndex, that returns the length < of the string if no element is found, rather than Nothing. p1Perform an operation with a temporary ByteString u789:q;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghihjklmnoipqrstuvwxyz{|}~String to search for String to search in ,Head and tail of string broken at substring String to search for. String to seach in. String to search for. String to seach in. krstopuvwxyh%789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~h%789:=>E?ADB@C;<FGHoIJKNOLMPQRSTUVWZ[\]XY^_`abcdeijfhmnlk|}~wxzy{pqsruvtgu789:q;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghihjklmnoipqrstuvwxyz{|}~krstopuvwxyportablestable.dons00@gmail.com, duncan@community.haskell.org TrustworthyGO(1) Convert a / into a % O(n) Convert a m into a % FFor applications with large numbers of string literals, pack can be a  bottleneck. O(n) Converts a % to a m. O(n) 1 is analogous to (:) for lists, but of different & complexity, as it requires a memcpy. O(n) Append a Char to the end of a % . Similar to  #, this function performs a memcpy. O(1)> Extract the head and tail of a ByteString, returning Nothing  if it is empty. O(1) Extract the C and $ of a ByteString, returning Nothing  if it is empty. O(1)E Extract the first element of a ByteString, which must be non-empty. O(1)G Extract the last element of a packed string, which must be non-empty. O(n)  f xs( is the ByteString obtained by applying f to each element of xs O(n) The  function takes a Char and a %  and ` intersperses'' that Char between the elements of the  %9. It is analogous to the intersperse function on Lists. <, applied to a binary operator, a starting value (typically C the left-identity of the operator), and a ByteString, reduces the ; ByteString using the binary operator, from left to right.  'foldl\''/ is like foldl, but strict in the accumulator. 1, applied to a binary operator, a starting value F (typically the right-identity of the operator), and a packed string, J reduces the packed string using the binary operator, from right to left.  'foldr\'' is a strict variant of foldr  is a variant of  that has no starting value 1 argument, and thus must be applied to non-empty  ByteStrings. A strict version of   is a variant of & that has no starting value argument, ' and thus must be applied to non-empty %s A strict variant of foldr1 Map a function over a % and concatenate the results )Applied to a predicate and a ByteString,  determines if  any element of the % satisfies the predicate. Applied to a predicate and a %,  determines if  all elements of the % satisfy the predicate. " returns the maximum value from a % " returns the minimum value from a % The ( function behaves like a combination of  and  9; it applies a function to each element of a ByteString, G passing an accumulating parameter from left to right, and returning a = final value of this accumulator together with the new list. The ( function behaves like a combination of  and  9; it applies a function to each element of a ByteString, G passing an accumulating parameter from right to left, and returning a C final value of this accumulator together with the new ByteString.  is similar to #, but returns a list of successive  reduced values from the left:  B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs.  is a variant of & that has no starting value argument: 0 scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] *scanr is the right-to-left dual of scanl.  is a variant of & that has no starting value argument. O(n)  n x is a ByteString of length n with x 2 the value of every element. The following holds:  0 replicate w c = unfoldr w (\u -> Just (u,u)) c This implemenation uses  memset(3) O(n), where n# is the length of the result. The  # function is analogous to the List 'unfoldr'.  builds a D ByteString from a seed value. The function takes the element and  returns e4 if it is done producing the ByteString or returns  f (a,b), in which case, a' is the next character in the string,  and b+ is the seed value for further production.  Examples: T unfoldr (\x -> if x <= '9' then Just (x, succ x) else Nothing) '0' == "0123456789" O(n) Like , ! builds a ByteString from a seed C value. However, the length of the result is limited by the first  argument to (. This function is more efficient than  1 when the maximum length of the result is known. The following equation relates  and : ( unfoldrN n f s == take n (unfoldr f s) , applied to a predicate p and a ByteString xs, 0 returns the longest prefix (possibly empty) of xs of elements that  satisfy p.  p xs$ returns the suffix remaining after  p xs.  p is equivalent to  (g . p). zz7 breaks its ByteString argument at the first occurence 2 of the specified char. It is more efficient than  as it is  implemented with  memchr(3). I.e. . break (=='c') "abcd" == breakChar 'c' "abcd"  p xs0 breaks the ByteString into two segments. It is  equivalent to ( p xs,  p xs)  behaves like  but from the end of the %.  We have  / spanEnd (not.isSpace) "x y z" == ("x y ","z") and  spanEnd (not . isSpace) ps  == H let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x)  behaves like  but from the end of the % breakEnd p == spanEnd (not.p) O(n) Break a %# into pieces separated by the byte ) argument, consuming the delimiter. I.e.  . split '\n' "a\nb\nd\ne" == ["a","b","d","e"] 0 split 'a' "aXaXaXa" == ["","X","X","X",""] $ split 'x' "x" == ["",""] and  ! intercalate [c] . split c == id  split == splitWith . (==) CAs for all splitting functions in this library, this function does 1 not copy the substrings, it just constructs new  ByteStrings that  are slices of the original. O(n) Splits a % into components delimited by G separators, where the predicate returns True for a separator element. G The resulting components do not contain the separators. Two adjacent = separators result in an empty component in the output. eg. 4 splitWith (=='a') "aabbaca" == ["","","bb","c",""] The + function is the non-overloaded version of m. O(1) %. index (subscript) operator, starting from 0. O(n) The ) function returns the index of the first  element in the given %# which is equal (by memchr) to the  query element, or e if there is no such element. O(n) The ( function returns the last index of the  element in the given % which is equal to the query  element, or e, if there is no such element. The following  holds:  elemIndexEnd c xs == 5 (-) (length xs - 1) `fmap` elemIndex c (reverse xs) O(n) The  function extends , by returning M the indices of all elements equal to the query element, in ascending order. The " function takes a predicate and a % and T returns the index of the first element in the ByteString satisfying the predicate. The  function extends , by returning the G indices of all elements satisfying the predicate, in ascending order. Icount returns the number of times its argument appears in the ByteString   count = length . elemIndices Also   count '\n' == length . lines ABut more efficiently than using length on the intermediate list. O(n)  is the % membership predicate. This  implementation uses  memchr(3). O(n)  is the inverse of  O(n) +, applied to a predicate and a ByteString, C returns a ByteString containing those characters that satisfy the  predicate. O(n) The . function takes a predicate and a ByteString, = and returns the first element in matching the predicate, or e  if there is no such element. O(n) - takes two ByteStrings and returns a list of A corresponding pairs of Chars. If one input ByteString is short, A excess elements of the longer ByteString are discarded. This is  equivalent to a pair of  operations, and so space 3 usage may be large for multi-megabyte ByteStrings  generalises ' by zipping with the function given as B the first argument, instead of a tupling function. For example,   (+)3 is applied to two ByteStrings to produce the list  of corresponding sums. 4 transforms a list of pairs of Chars into a pair of * ByteStrings. Note that this performs two  operations. { A variety of  for non-empty ByteStrings. { omits B the check for the empty case, which is good for performance, but F there is an obligation on the programmer to provide a proof that the  ByteString is non-empty. ||6 returns the pair of ByteStrings when the argument is + broken at the first whitespace byte. I.e.  break isSpace == breakSpace }} efficiently returns the % argument with E white space Chars removed from the front. It is more efficient than 1 calling dropWhile for removing whitespace. I.e.  dropWhile isSpace == dropSpace 6 breaks a ByteString up into a list of ByteStrings at ? newline Chars. The resulting strings do not contain newlines.  is an inverse operation to . It joins lines, 0 after appending a terminating newline to each. 4 breaks a ByteString up into a list of words, which 3 were delimited by Chars representing white space. The  function is analogous to the  function, on words. KreadInt reads an Int from the beginning of the ByteString. If there is no G integer at the beginning of the string, it returns Nothing, otherwise ; it just returns the int read, and the rest of the string. GreadInteger reads an Integer from the beginning of the ByteString. If I there is no integer at the beginning of the string, it returns Nothing, E otherwise it just returns the int read, and the rest of the string. $Read an entire file strictly into a %. This is far more . efficient than reading the characters into a m and then using  ;. It also may be more efficient than opening the file and  reading it using hGet. Write a % to a file.  Append a % to a file. 9Write a ByteString to a handle, appending a newline byte 7Write a ByteString to stdout, appending a newline byte Iz{|~}l%7;<@CEGIRabcmo|}~l%7E@C;<GoIRabcm|}~Iz{|~} non-portableunstable.dons00@gmail.com, duncan@community.haskell.orgNone DA space-efficient representation of a Word8 vector, supporting many  efficient operations. A ! contains 8-bit characters only. 1Instances of Eq, Ord, Read, Show, Data, Typeable The data type invariant:  Every ByteString is either  or consists of non-null %s. J All functions must preserve this, and the QC properties must check this. ,In a form that checks the invariant lazily. Smart constructor for &. Guarantees the data type invariant. CConsume the chunks of a lazy ByteString with a natural right fold. GConsume the chunks of a lazy ByteString with a strict, tail-recursive,  accumulating left fold. The chunk size used for I/=O. Currently set to 32k, less the memory management overhead UThe recommended chunk size. Currently set to 4k, less the memory management overhead FThe memory management overhead. Currently this is tuned for GHC only. portablestable.dons00@gmail.com, duncan@community.haskell.org Trustworthy\O(1) The empty  O(1) Convert a . into a  O(n) Convert a '[Word8]' into a . O(n) Converts a  to a '[Word8]'. O(c) Convert a list of strict  into a lazy  O(c) Convert a lazy  into a list of strict  O(1) Convert a strict  into a lazy . O(n) Convert a lazy  into a strict . Note that this is an  expensive& operation that forces the whole lazy J ByteString into memory and then copies all the data. If possible, try to F avoid converting back and forth between strict and lazy bytestrings. O(1)% Test whether a ByteString is empty. O(n\c)/ * returns the length of a ByteString as an   O(1)  is analogous to '(:)' for lists. O(1) Unlike , 'cons\'' is N strict in the ByteString that we are consing onto. More precisely, it forces N the head and the first chunk. It does this because, for space efficiency, it * may coalesce the new byte onto the first 'chunk' rather than starting a  new 'chunk'. So that means you can'.t use a lazy recursive contruction like this:   let xs = cons\' c xs in xs You can however use  , as well as  and  , to build  infinite lazy ByteStrings. O(n\c)/ Append a byte to the end of a  O(1)E Extract the first element of a ByteString, which must be non-empty. O(1)> Extract the head and tail of a ByteString, returning Nothing  if it is empty. O(1)D Extract the elements after the head of a ByteString, which must be  non-empty. O(n\c)/@ Extract the last element of a ByteString, which must be finite  and non-empty. O(n\c)/ Return all the elements of a  except the last one. O(n\c)/ Extract the  and $ of a ByteString, returning Nothing  if it is empty.  It is no faster than using  and  O(n\c)/ Append two ByteStrings O(n)  f xs( is the ByteString obtained by applying f to each  element of xs. O(n)  xs returns the elements of xs in reverse order. The  function takes a . and a  and  ` intersperses'' that byte between the elements of the . 7 It is analogous to the intersperse function on Lists. The 1 function transposes the rows and columns of its   argument. <, applied to a binary operator, a starting value (typically C the left-identity of the operator), and a ByteString, reduces the ; ByteString using the binary operator, from left to right.  'foldl\'' is like !, but strict in the accumulator. 1, applied to a binary operator, a starting value C (typically the right-identity of the operator), and a ByteString, G reduces the ByteString using the binary operator, from right to left.  is a variant of  that has no starting value 1 argument, and thus must be applied to non-empty  ByteStrings. + This function is subject to array fusion.  'foldl1\'' is like !, but strict in the accumulator.  is a variant of & that has no starting value argument, ' and thus must be applied to non-empty s O(n)$ Concatenate a list of ByteStrings. Map a function over a  and concatenate the results O(n)* Applied to a predicate and a ByteString,  determines if  any element of the  satisfies the predicate. O(n) Applied to a predicate and a ,  determines  if all elements of the  satisfy the predicate. O(n) " returns the maximum value from a   O(n)  " returns the minimum value from a   The  ( function behaves like a combination of  and  9; it applies a function to each element of a ByteString, G passing an accumulating parameter from left to right, and returning a C final value of this accumulator together with the new ByteString.  The  ( function behaves like a combination of  and  9; it applies a function to each element of a ByteString, G passing an accumulating parameter from right to left, and returning a C final value of this accumulator together with the new ByteString.    is similar to #, but returns a list of successive 8 reduced values from the left. This function will fuse.  B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs.    f x9 returns an infinite ByteString of repeated applications  of f to x: ' iterate f x == [x, f x, f (f x), ...]  x! is an infinite ByteString, with x the value of every  element. O(n)  n x is a ByteString of length n with x  the value of every element. @ ties a finite ByteString into a circular one, or equivalently, 5 the infinite repetition of the original ByteString. O(n) The # function is analogous to the List 'unfoldr'.  < builds a ByteString from a seed value. The function takes  the element and returns e if it is done producing the  ByteString or returns f (a,b), in which case, a is a " prepending to the ByteString and b" is used as the next element in a  recursive call. O(n\c)/  n, applied to a ByteString xs, returns the prefix  of xs of length n, or xs itself if n >  xs. O(n\c)/  n xs returns the suffix of xs after the first n  elements, or [] if n >  xs. O(n\c)/  n xs is equivalent to ( n xs,  n xs). , applied to a predicate p and a ByteString xs, 0 returns the longest prefix (possibly empty) of xs of elements that  satisfy p.  p xs$ returns the suffix remaining after  p xs.  p is equivalent to  (g . p).  p xs0 breaks the ByteString into two segments. It is  equivalent to ( p xs,  p xs) O(n) Splits a  into components delimited by G separators, where the predicate returns True for a separator element. G The resulting components do not contain the separators. Two adjacent = separators result in an empty component in the output. eg. 4 splitWith (=='a') "aabbaca" == ["","","bb","c",""] # splitWith (=='a') [] == [] O(n) Break a # into pieces separated by the byte ) argument, consuming the delimiter. I.e.  . split '\n' "a\nb\nd\ne" == ["a","b","d","e"] 0 split 'a' "aXaXaXa" == ["","X","X","X",""] $ split 'x' "x" == ["",""] and  ! intercalate [c] . split c == id  split == splitWith . (==) CAs for all splitting functions in this library, this function does 1 not copy the substrings, it just constructs new  ByteStrings that  are slices of the original. The 3 function takes a ByteString and returns a list of G ByteStrings such that the concatenation of the result is equal to the E argument. Moreover, each sublist in the result contains only equal  elements. For example,  < group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"] It is a special case of !, which allows the programmer to ! supply their own equality test. The + function is the non-overloaded version of . O(n) The  function takes a  and a list of  :s and concatenates the list after interspersing the first , argument between each element of the list. O(c) . index (subscript) operator, starting from 0. O(n) The ) function returns the index of the first  element in the given  which is equal to the query  element, or e if there is no such element. % This implementation uses memchr(3).  O(n) The   function extends , by returning M the indices of all elements equal to the query element, in ascending order. % This implementation uses memchr(3). !Icount returns the number of times its argument appears in the ByteString   count = length . elemIndices ABut more efficiently than using length on the intermediate list. "The "" function takes a predicate and a  and : returns the index of the first element in the ByteString  satisfying the predicate. #O(n) The #. function takes a predicate and a ByteString, = and returns the first element in matching the predicate, or e  if there is no such element. H find f p = case findIndex f p of Just n -> Just (p ! n) ; _ -> Nothing $The $ function extends ", by returning the G indices of all elements satisfying the predicate, in ascending order. %O(n) % is the  membership predicate. &O(n) & is the inverse of % 'O(n) '+, applied to a predicate and a ByteString, C returns a ByteString containing those characters that satisfy the  predicate. (O(n) The (5 function takes a predicate a ByteString and returns G the pair of ByteStrings with elements which do and do not satisfy the  predicate, respectively; i.e., 6 partition p bs == (filter p xs, filter (not . p) xs) )O(n) The ), function takes two ByteStrings and returns j * iff the first is a prefix of the second. *O(n) The *, function takes two ByteStrings and returns j * iff the first is a suffix of the second. The following holds: 4 isSuffixOf x y == reverse x `isPrefixOf` reverse y +O(n) +- takes two ByteStrings and returns a list of A corresponding pairs of bytes. If one input ByteString is short, A excess elements of the longer ByteString are discarded. This is  equivalent to a pair of  operations. ,, generalises +' by zipping with the function given as B the first argument, instead of a tupling function. For example,  , (+)6 is applied to two ByteStrings to produce the list of  corresponding sums. -O(n) -4 transforms a list of pairs of bytes into a pair of * ByteStrings. Note that this performs two  operations. .O(n)* Return all initial segments of the given , shortest first. /O(n)( Return all final segments of the given , longest first. 0O(n) Make a copy of the  with its own storage. ? This is mainly useful to allow the rest of the data pointed  to by the & to be garbage collected, for example C if a large string has been read in, and only a small part of it ) is needed in the rest of the program. Read entire handle contents lazily into a  . Chunks  are read on demand, in at most k!-sized chunks. It does not block  waiting for a whole k-sized chunk, so if less than k bytes are F available then they will be returned immediately as a smaller chunk. The handle is closed on EOF.  Note: the l& should be placed in binary mode with   for  to  work correctly. Read n bytes into a , directly from the  specified l, in chunks of size k. hGetNonBlockingN is similar to ", except that it will never block M waiting for data to become available, instead it returns only whatever data - is available. Chunks are read on demand, in k-sized chunks. 1Read entire handle contents lazily into a  . Chunks 3 are read on demand, using the default chunk size. /Once EOF is encountered, the Handle is closed.  Note: the l& should be placed in binary mode with   for 1 to  work correctly. 2Read n bytes into a , directly from the specified l. 3hGetNonBlocking is similar to 2", except that it will never block M waiting for data to become available, instead it returns only whatever data : is available. If there is no data available to be read, 3  returns . FNote: on Windows and with Haskell implementation other than GHC, this = function does not work correctly; it behaves identically to 2. 4Read an entire file lazily into a . 8 The Handle will be held open until EOF is encountered. 5Write a  to a file. 6 Append a  to a file. 79getContents. Equivalent to hGetContents stdin. Will read lazily 8 Outputs a  to the specified l. 9 Similar to 85 except that it will never block. Instead it returns 5 any tail that did not get written. This tail may be  in the case that K the whole string was written, or the whole original string if nothing was , written. Partial writes are also possible. FNote: on Windows and with Haskell implementation other than GHC, this = function does not work correctly; it behaves identically to 8. :A synonym for hPut, for compatibility ;Write a ByteString to stdout <7Write a ByteString to stdout, appending a newline byte =/The interact function takes a function of type ByteString -> ByteString L as its argument. The entire input from the standard input device is passed M to this function as its argument, and the resulting string is output on the  standard output device. 4 is a variant of findIndex, that returns the length < of the string if no element is found, rather than Nothing. a      !"#$%&'()*+,-./0123456789:;<=[      !"#$%&'()*+,-./0123456789:;<=[     ./)*%&#'( "$!+,-07;<=45612389:a      !"#$%&'()*+,-./0123456789:;<=portablestable.dons00@gmail.com, duncan@community.haskell.org Trustworthy<>O(1) Convert a / into a  ?O(n) Convert a m into a . @O(n) Converts a  to a m. AO(1) A is analogous to '(:)' for lists. BO(1) Unlike A, 'cons\'' is N strict in the ByteString that we are consing onto. More precisely, it forces N the head and the first chunk. It does this because, for space efficiency, it * may coalesce the new byte onto the first 'chunk' rather than starting a  new 'chunk'. So that means you can'.t use a lazy recursive contruction like this:   let xs = cons\' c xs in xs You can however use A , as well as Y and  , to build  infinite lazy ByteStrings. CO(n) Append a Char to the end of a  . Similar to  A#, this function performs a memcpy. DO(1)E Extract the first element of a ByteString, which must be non-empty. EO(1)> Extract the head and tail of a ByteString, returning Nothing  if it is empty. FO(n\c)/ Extract the  and G$ of a ByteString, returning Nothing  if it is empty. GO(1)G Extract the last element of a packed string, which must be non-empty. HO(n) H f xs( is the ByteString obtained by applying f to each element of xs IO(n) The I function takes a Char and a   and ` intersperses'' that Char between the elements of the  9. It is analogous to the intersperse function on Lists. JJ<, applied to a binary operator, a starting value (typically C the left-identity of the operator), and a ByteString, reduces the ; ByteString using the binary operator, from left to right. K 'foldl\''/ is like foldl, but strict in the accumulator. LL1, applied to a binary operator, a starting value F (typically the right-identity of the operator), and a packed string, J reduces the packed string using the binary operator, from right to left. MM is a variant of J that has no starting value 1 argument, and thus must be applied to non-empty  ByteStrings. N 'foldl1\'' is like M!, but strict in the accumulator. OO is a variant of L& that has no starting value argument, ' and thus must be applied to non-empty s PMap a function over a  and concatenate the results Q)Applied to a predicate and a ByteString, Q determines if  any element of the  satisfies the predicate. RApplied to a predicate and a , R determines if  all elements of the  satisfy the predicate. SS" returns the maximum value from a  TT" returns the minimum value from a  UU is similar to J#, but returns a list of successive 8 reduced values from the left. This function will fuse.  B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs. VThe V( function behaves like a combination of H and  J9; it applies a function to each element of a ByteString, G passing an accumulating parameter from left to right, and returning a C final value of this accumulator together with the new ByteString. WThe W( function behaves like a combination of H and  L9; it applies a function to each element of a ByteString, G passing an accumulating parameter from right to left, and returning a C final value of this accumulator together with the new ByteString. XX f x9 returns an infinite ByteString of repeated applications  of f to x: ' iterate f x == [x, f x, f (f x), ...] YY x! is an infinite ByteString, with x the value of every  element. ZO(n) Z n x is a ByteString of length n with x  the value of every element. [O(n) The [# function is analogous to the List 'unfoldr'.  [< builds a ByteString from a seed value. The function takes  the element and returns e if it is done producing the  ByteString or returns f (a,b), in which case, a is a " prepending to the ByteString and b" is used as the next element in a  recursive call. \\, applied to a predicate p and a ByteString xs, 0 returns the longest prefix (possibly empty) of xs of elements that  satisfy p. ]] p xs$ returns the suffix remaining after \ p xs. ^^ p is equivalent to _ (g . p). __ p xs0 breaks the ByteString into two segments. It is  equivalent to (\ p xs, ] p xs) `O(n) Break a # into pieces separated by the byte ) argument, consuming the delimiter. I.e.  . split '\n' "a\nb\nd\ne" == ["a","b","d","e"] - split 'a' "aXaXaXa" == ["","X","X","X"] $ split 'x' "x" == ["",""] and  ! intercalate [c] . split c == id  split == splitWith . (==) CAs for all splitting functions in this library, this function does 1 not copy the substrings, it just constructs new  ByteStrings that  are slices of the original. aO(n) Splits a  into components delimited by G separators, where the predicate returns True for a separator element. G The resulting components do not contain the separators. Two adjacent = separators result in an empty component in the output. eg. 4 splitWith (=='a') "aabbaca" == ["","","bb","c",""] bThe b+ function is the non-overloaded version of . cO(1) . index (subscript) operator, starting from 0. dO(n) The d) function returns the index of the first  element in the given # which is equal (by memchr) to the  query element, or e if there is no such element. eO(n) The e function extends d, by returning M the indices of all elements equal to the query element, in ascending order. fThe f" function takes a predicate and a  and T returns the index of the first element in the ByteString satisfying the predicate. gThe g function extends f, by returning the G indices of all elements satisfying the predicate, in ascending order. hIcount returns the number of times its argument appears in the ByteString  $ count == length . elemIndices  count '\n' == length . lines ABut more efficiently than using length on the intermediate list. iO(n) i is the  membership predicate. This  implementation uses  memchr(3). jO(n) j is the inverse of i kO(n) k+, applied to a predicate and a ByteString, C returns a ByteString containing those characters that satisfy the  predicate. lO(n) The l. function takes a predicate and a ByteString, = and returns the first element in matching the predicate, or e  if there is no such element. mO(n) m- takes two ByteStrings and returns a list of A corresponding pairs of Chars. If one input ByteString is short, A excess elements of the longer ByteString are discarded. This is  equivalent to a pair of @ operations, and so space 3 usage may be large for multi-megabyte ByteStrings nn generalises m' by zipping with the function given as B the first argument, instead of a tupling function. For example,  n (+)3 is applied to two ByteStrings to produce the list  of corresponding sums. oo6 breaks a ByteString up into a list of ByteStrings at ? newline Chars. The resulting strings do not contain newlines. >As of bytestring 0.9.0.3, this function is stricter than its  list cousin. pp is an inverse operation to o. It joins lines, 0 after appending a terminating newline to each. qq4 breaks a ByteString up into a list of words, which 7 were delimited by Chars representing white space. And  tokens isSpace = words rThe r function is analogous to the p function, on words. s?readInt reads an Int from the beginning of the ByteString. If @ there is no integer at the beginning of the string, it returns F Nothing, otherwise it just returns the int read, and the rest of the  string. tGreadInteger reads an Integer from the beginning of the ByteString. If I there is no integer at the beginning of the string, it returns Nothing, E otherwise it just returns the int read, and the rest of the string. uRead an entire file lazily into a . vWrite a  to a file. w Append a  to a file. x9Write a ByteString to a handle, appending a newline byte y7Write a ByteString to stdout, appending a newline byte =>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy])./0123789:;=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy]>?@ABCDEGFHIJKMNLOPQRSTUVWYZX[\]_^b./`aoqpr)ijlkcdefghmn0st7;y=uvw12389:x=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyGHCunstable, private Simon Meier <iridcode@gmail.com>None&.A stream of non-empty chunks interleaved with . z+A buffer allocation strategy for executing {s. A A action denotes a computation of a value that writes a stream of  bytes as a side-effect. -s are strict in their side-effect; i.e., the E stream of bytes will always be written before the computed value is  returned. s are a generalization of {%s. They are used when values need to L be returned during the computation of a stream of bytes. For example, when & performing a block-based encoding of %s like Base64 encoding, 5 there might be a left-over partial block. Using the  monad, this L partial block can be returned after the complete blocks have been encoded. K Then, in a later step when more input is known, this partial block can be  completed and also encoded. Put () actions are isomorphic to {s. The functions   and = convert between these two types. Where possible, you should  use {%s, as they are slightly cheaper than s because they do not  carry a computed value. {{s denote sequences of bytes.  They are s where  ! is the zero-length sequence and  ! is concatenation, which runs in O(1). &s abstract signals to the caller of a  . There are  exactly three signals: , , and . 9s may assume that they are called at most once. However, G they must not execute any function that may rise an async. exception, & as this would invalidate the code of  below. JA range of bytes in a buffer represented by the pointer to the first byte 0 of the range and the pointer to the first byte after the range. Signal that the current # is done and has computed a value. (Signal that the current buffer is full. 8Signal that several chunks should be inserted directly. Fill a  using a .  Construct a {. In contrast to s, {s are  referentially transparent. Run a {. Run a {. The {< denoting a zero-length sequence of bytes. This function is / only exported for use in rewriting rules. Use  otherwise. Concatenate two {7s. This function is only exported for use in rewriting  rules. Use  otherwise. |<Flush the current buffer. This introduces a chunk boundary.  Construct a  action. In contrast to s, s are A referentially transparent in the sense that sequencing the same  L multiple times yields every time the same value with the same side-effect. Run a . Run a { as a side-effect of a Put () action.  Convert a Put () action to a {. Run a - action redirecting the produced output to a l. !The output is buffered using the ls associated buffer. If this 0 buffer is too small to execute one step of the  action, then , it is replaced with a large enough buffer. Ensure that there are at least n free bytes for the following {. Copy the bytes from a  into the output stream. } Construct a { that copies the strict % s, if it is ? smaller than the treshold, and inserts it directly otherwise.  For example, byteStringThreshold 1024 copies strict % s whose size L is less or equal to 1kb, and inserts them directly otherwise. This implies 3 that the average chunk-size of the generated lazy  may be as K low as 513 bytes, as there could always be just a single byte between the % directly inserted 1025 byte, strict %s. ~ Construct a { that copies the strict %. Use this function to create {s from smallish (<= 4kb)  %'s or if you need to guarantee that the % is not ) shared with the chunks generated by the {.  Construct a { that always inserts the strict %  directly as a chunk. BThis implies flushing the output buffer, even if it contains just ) a single byte. You should therefore use  only for large  (> 8kb) %+s. Otherwise, the generated chunks are too 4 fragmented to be processed efficiently afterwards.  Construct a {( that uses the thresholding strategy of }  for each chunk of the lazy .  Construct a { that copies the lazy .  Construct a {% that inserts all chunks of the lazy   directly.  Create a {1 denoting the same sequence of bytes as a strict  %.  The { inserts large %"s directly, but copies small ones ; to ensure that the generated chunks are large on average.  Create a {/ denoting the same sequence of bytes as a lazy  %.  The {" inserts large chunks of the lazy  directly, H but copies small ones to ensure that the generated chunks are large on  average. The maximal size of a % that is copied.  2 * , to guarantee that on average a chunk is of  .  Insert a  of the given size directly. =Sanitize a buffer size; i.e., make it at least the size of a !. &Use this strategy for generating lazy s whose chunks are M discarded right after they are generated. For example, if you just generate ) them to write them to a network socket. &Use this strategy for generating lazy s whose chunks are G likely to survive one garbage collection. This strategy trims buffers L that are filled less than half in order to avoid spilling too much memory.  Execute a {# with custom execution parameters. JThis function is forced to be inlined to allow fusing with the allocation E strategy despite its rather heavy code-size. We therefore recommend L that you introduce a top-level function once you have fixed your strategy. + This avoids unnecessary code duplication.  For example, the default { execution function toLazyByteString is  defined as follows.    {- NOINLINE toLazyByteString -}  toLazyByteString =  toLazyByteStringWith (  ) empty where empty is the zero-length lazy . &In most cases, the parameters used by toLazyByteString give good ' performance. A sub-performing case of toLazyByteString is executing short  (< 128 bytes) {7s. In this case, the allocation overhead for the first E 4kb buffer and the trimming cost dominate the cost of executing the  {#. You can avoid this problem using  =toLazyByteStringWith (safeStrategy 128 smallChunkSize) empty DThis reduces the allocation and trimming overhead, as all generated  5s fit into the first buffer and there is no trimming . required, if more than 64 bytes are written. ;z{Next free byte in current  Computed value Minimal size of next . Next free byte in current .  to run on the next . This  % may assume that it is called with a  of at least the 1 required minimal size; i.e., the caller of this  must  guarantee this. Next free byte in current  Number of bytes in  continuation. Chunks to insert.  to run on next  "Build step to use for filling the .  Handling the  signal  Handling the  signal  Handling the  signal Buffer range to fill. Value computed by filling this . A function that fills a , calls the continuation with  the updated + once its done, and signals its caller how  to proceed using , , or  insertChunk. BThis function must be referentially transparent; i.e., calling it @ multiple times must result in the same sequence of bytes being E written. If you need mutable state, then you must allocate it newly D upon each call of this function. Moroever, this function must call = the continuation once its done. Otherwise, concatenation of  {:s does not work. Finally, this function must write to all ? bytes that it claims it has written. Otherwise, the resulting  {7 is not guaranteed to be referentially transparent and  sensitive data might leak. { to run % that writes the byte stream of this  { and signals  upon completion. { to run  Continuation  |A function that fills a , calls the continuation with  the updated + and its computed value once its done, and ) signals its caller how to proceed using , , or   insertChunk. BThis function must be referentially transparent; i.e., calling it @ multiple times must result in the same sequence of bytes being G written and the same value being computed. If you need mutable state, B then you must allocate it newly upon each call of this function. C Moroever, this function must call the continuation once its done. " Otherwise, monadic sequencing of s does not work. Finally, this A function must write to all bytes that it claims it has written.  Otherwise, the resulting ' is not guaranteed to be referentially , transparent and sensitive data might leak.  Put to run & that first writes the byte stream of  this * and then yields the computed value using  the  signal. Input . }~Size of the first buffer Size of successive buffers 5An allocation strategy that does not trim any of the 1 filled buffers before converting it to a chunk. Size of first buffer Size of successive buffers :An allocation strategy that guarantees that at least half / of the allocated memory is used for live data "Buffer allocation strategy to use Lazy * to use as the tail of the generated lazy   Builder to execute Resulting lazy  "Buffer allocation strategy to use !Continuation stream constructor.  to execute 0z{|}~0z{|}~GHC experimental Simon Meier <iridcode@gmail.com>None'An encoding table for Base16 encoding. FThe encoding table for hexadecimal values with lower-case characters;  e.g., deadbeef. Encode a nibble as an octet. 6 encode4_as_8 lowerTable 10 = fromIntegral (char 'a') FEncode an octet as 16bit word comprising both encoded nibbles ordered L according to the host endianness. Writing these 16bit to memory will write 5 the nibbles in the correct order (i.e. big-endian). GHC Simon Meier <iridcode@gmail.com>NoneEncode the least 7-bits of a / using the ASCII encoding. Decimal encoding of an . Decimal encoding of an . Decimal encoding of an . Decimal encoding of an  . Decimal encoding of an !. Decimal encoding of a .. Decimal encoding of a . Decimal encoding of a . Decimal encoding of a . Decimal encoding of a . Hexadecimal encoding of a .. Hexadecimal encoding of a . Hexadecimal encoding of a . Hexadecimal encoding of a . Hexadecimal encoding of a .  Encode a .' using 2 nibbles (hexadecimal digits).  Encode a  using 4 nibbles.  Encode a  using 8 nibbles.  Encode a  using 16 nibbles.  Encode a ' using 2 nibbles (hexadecimal digits).  Encode a  using 4 nibbles.  Encode a  using 8 nibbles.  Encode a   using 16 nibbles. Encode an IEEE  using 8 nibbles. Encode an IEEE  using 16 nibbles. ##GHC Simon Meier <iridcode@gmail.com>None Encode a value with a . 2Encode a list of values from left-to-right with a . *Encode a list of values represented as an  with a . Heavy inlining. Encode all bytes of a strict % from  left-to-right with a (. This function is quite versatile. For ' example, we can use it to construct a { that maps every byte before ( copying it to the buffer to be filled.  = mapToBuilder :: (Word8 -> Word8) -> S.ByteString -> Builder = mapToBuilder f = encodeByteStringWithF (contramapF f word8) *We can also use it to hex-encode a strict % as shown by the   byteStringHex example above. Heavy inlining. Encode all bytes of a lazy  from  left-to-right with a .  Create a {$ that encodes values with the given . We rewrite consecutive uses of  such that the bound-checks are  fused. For example,  ; primBounded (word32 c1) `mappend` primBounded (word32 c2) %is rewritten such that the resulting { checks only once, if ther are M at 8 free bytes, instead of checking twice, if there are 4 free bytes. This I optimization is not observationally equivalent in a strict sense, as it K influences the boundaries of the generated chunks. However, for a user of N this library it is observationally equivalent, as chunk boundaries of a lazy  6 can only be observed through the internal interface. H Morevoer, we expect that all primitives write much fewer than 4kb (the H default short buffer size). Hence, it is safe to ignore the additional M memory spilled due to the more agressive buffer wrapping introduced by this  optimization.  Create a {5 that encodes a list of values consecutively using a  < for each element. This function is more efficient than the  canonical   filter p =  B.toLazyByteString . : E.encodeLazyByteStringWithF (E.ifF p E.word8) E.emptyF)    mconcat . map (primBounded w) or   foldMap (primBounded w) :because it moves several variables out of the inner loop.  Create a {5 that encodes a sequence generated from a seed value  using a  for each sequence element.  Create a { that encodes each . of a strict %  using a . For example, we can write a { that filters  a strict % as follows.  @ import Data.ByteString.Builder.Primas P (word8, condB, emptyB) ) filterBS p = P.condB p P.word8 P.emptyB Chunk-wise application of . Char8 encode a /. UTF-8 encode a /. KEncode a Unicode character to another datatype, using UTF-8. This function J acts as an abstract way of encoding characters, as it is unaware of what L needs to happen with the resulting bytes: you have to specify functions to  deal with those.  1-byte UTF-8  2-byte UTF-8  3-byte UTF-8  4-byte UTF-8 Input / Result K  !"#$K  !  "#$ GHC Simon Meier <iridcode@gmail.com>None Encode a m using . Decimal encoding of an  using the ASCII digits. e.g. ( toLazyByteString (int8Dec 42) = "42" ( toLazyByteString (int8Dec (-1)) = "-1" Decimal encoding of an  using the ASCII digits. Decimal encoding of an  using the ASCII digits. Decimal encoding of an   using the ASCII digits. Decimal encoding of an ! using the ASCII digits. Currently slow. Decimal encoding of an  using the ASCII digits. Decimal encoding of a . using the ASCII digits. Decimal encoding of a  using the ASCII digits. Decimal encoding of a  using the ASCII digits. Decimal encoding of a  using the ASCII digits. Decimal encoding of a  using the ASCII digits. Currently slow. Decimal encoding of an IEEE . Currently slow. Decimal encoding of an IEEE . #Shortest hexadecimal encoding of a . using lower-case characters. #Shortest hexadecimal encoding of a  using lower-case characters. #Shortest hexadecimal encoding of a  using lower-case characters. #Shortest hexadecimal encoding of a  using lower-case characters. #Shortest hexadecimal encoding of a  using lower-case characters.  Encode a ' using 2 nibbles (hexadecimal digits).  Encode a  using 4 nibbles.  Encode a  using 8 nibbles.  Encode a   using 16 nibbles.  Encode a .' using 2 nibbles (hexadecimal digits).  Encode a  using 4 nibbles.  Encode a  using 8 nibbles.  Encode a  using 16 nibbles. Encode an IEEE  using 8 nibbles. Encode an IEEE  using 16 nibbles. Encode each byte of a %% using its fixed-width hex encoding. Encode each byte of a lazy % using its fixed-width hex encoding. GHC Simon Meier <iridcode@gmail.com>None Execute a {+ and return the generated chunks as a lazy . A The work is performed lazy, i.e., only when a chunk of the lazy   is forced.  Output a { to a l.  The {+ is executed directly on the buffer of the l . If the H buffer is too small (or not present), then it is replaced with a large  enough buffer. It is recommended that the l is set to binary and  BlockBuffering mode. See hSetBinaryMode and  hSetBuffering. %This function is more efficient than hPut .  because in J many cases no buffer allocation has to be done. Moreover, the results of  several executions of short {s are concatenated in the ls 8 buffer, therefore avoiding unnecessary buffer flushes. #Encode a single signed byte as-is. %Encode a single unsigned byte as-is.  Encode an  in little endian format.  Encode an  in little endian format.  Encode an   in little endian format.  Encode a  in little endian format.  Encode a  in little endian format.  Encode a  in little endian format.  Encode a  in little endian format.  Encode a  in little endian format.  Encode an  in big endian format.  Encode an  in big endian format.  Encode an   in big endian format.  Encode a  in big endian format.  Encode a  in big endian format.  Encode a  in big endian format.  Encode a  in big endian format.  Encode a  in big endian format. Char7 encode a /. Char7 encode a m. Char8 encode a /. Char8 encode a m. UTF-8 encode a /. UTF-8 encode a m. {;{None{None{GHC Simon Meier <iridcode@gmail.com>NoneAfter running a * action there are three possibilities for  what comes next: DIn addition to the data that has just been written into your buffer  by the + action, it gives you a pre-existing chunk  of data as a %". It also gives you the following  H action. It is safe to run this following action using a buffer with as 9 much free space as was left by the previous run action. 8This indicates that there may be more data to write. It  gives you the next % action. You should call that action 3 with an appropriate buffer. The int indicates the minimum buffer size  required by the next ' action. That is, if you call the next  action you must7 supply it with a buffer length of at least this size.  This means we'8re all done. All the builder data has now been written. A $ represents the result of running a {. M It unfolds as a sequence of chunks of data. These chunks come in two forms: % an IO action for writing the Builder'#s data into a user-supplied memory  buffer. 7 a pre-existing chunks of data represented by a strict  ByteString IWhile this is rather low level, it provides you with full flexibility in  how the data is written out. The 5 itself is an IO action: you supply it with a buffer C (as a pointer and length) and it will write data into the buffer. E It returns a number indicating how many bytes were actually written  (which can be 0). It also returns a  which describes what  comes next. Turn a { into its initial  action. Encode a single native machine !. The ! is encoded in host order, & host endian form, for the machine you're on. On a 64 bit machine the ! K is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way E are not portable to different endian or int sized machines, without  conversion.  Encode a + in native host order and host endianness.  Encode a + in native host order and host endianness.  Encode a  + in native host order and host endianness. Encode a single native machine . The  is encoded in host order, & host endian form, for the machine you're on. On a 64 bit machine the  K is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way F are not portable to different endian or word sized machines, without  conversion.  Encode a + in native host order and host endianness.  Encode a + in native host order and host endianness.  Encode a + in native host order and host endianness.  Encode a 7 in native host order. Values encoded this way are not < portable to different endian machines, without conversion.  Encode a  in native host order. z|}~z~}| Nonez|}~       ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~PQRUVY\WZ^`bcdefghiklmnopqrstuvwx|}~?OPQRSTUVWYXZ[\]^_`abcdfghjklmnopqrvwyz{|}~PQRUVWY\Z^`bcdfghklmnorpqvw|}~.#024%'):</13$&(9;   5678*+,-=>                ! "#$#%#&'( ) * + , - . / 0 1 2 3 4 5 6 7 8 9:;:<:= > ? @ A B C D E F G H I JK 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 ] j l m n o p q r s t u v wxWxXx[xZxyxTxz yz'{'| }~ @]^cdI]jpqrstuvw  O] D:wbytestring-0.10.2.0Data.ByteString.Builder.PrimData.ByteStringData.ByteString.UnsafeData.ByteString.Char8Data.ByteString.LazyData.ByteString.Builder.ExtraData.ByteString.Lazy.Char8Data.ByteString.Builder5Data.ByteString.Builder.Prim.Internal.UncheckedShifts%Data.ByteString.Builder.Prim.Internal.Data.ByteString.Builder.Prim.Internal.Floating#Data.ByteString.Builder.Prim.BinaryData.ByteString.InternalunsafePackCStringLenunsafePackCStringFinalizerData.ByteString.Lazy.Internal System.IOhSetBinaryMode Data.ByteString.Builder.Internal,Data.ByteString.Builder.Prim.Internal.Base16"Data.ByteString.Builder.Prim.ASCIIData.ByteString.Builder.ASCIIData.ByteString.Lazy.Builder"Data.ByteString.Lazy.Builder.ASCII#Data.ByteString.Lazy.Builder.Extras BoundedPrim FixedPrim>$<>*<emptyFliftFixedToBoundedemptyBeitherBcondBword8word16BEword16LEword32BEword32LEword64BEword64LEwordHost word16Host word32Host word64Hostint8int16BEint16LEint32BEint32LEint64BEint64LEintHost int16Host int32Host int64HostfloatBEfloatLEdoubleBEdoubleLE floatHost doubleHost ByteString unsafeHead unsafeTail unsafeInit unsafeLast unsafeIndex unsafeTake unsafeDropunsafePackAddressunsafePackAddressLenunsafeFinalizeunsafePackCStringunsafePackMallocCStringunsafePackMallocCStringLenunsafeUseAsCStringunsafeUseAsCStringLenempty singletonpackunpacknulllengthconssnocheadtailunconslastinitunsnocappendmapreverse intersperse transposefoldlfoldl'foldrfoldr'foldl1foldl1'foldr1foldr1'concat concatMapanyallmaximumminimum mapAccumL mapAccumRscanlscanl1scanrscanr1 replicateunfoldrunfoldrNtakedropsplitAt takeWhile dropWhilebreak breakBytebreakEndspanspanEnd splitWithsplitgroupgroupBy intercalateindex elemIndex elemIndexEnd elemIndicescount findIndex findIndiceselemnotElemfilterfind partition isPrefixOf isSuffixOf isInfixOfbreakSubstring findSubstringfindSubstringszipzipWithunzipinitstailssort useAsCStringuseAsCStringLen packCStringpackCStringLencopygetLinehGetLinehPuthPutNonBlockinghPutStr hPutStrLnputStrputStrLnhGethGetNonBlockinghGetSome hGetContents getContentsinteractreadFile writeFile appendFilelinesunlineswordsunwordsreadInt readInteger foldrChunks foldlChunksdefaultChunkSizesmallChunkSize fromChunkstoChunks fromStricttoStrictcons'iteraterepeatcycleAllocationStrategyBuilderflushbyteStringThresholdbyteStringCopybyteStringInsertlazyByteStringThresholdlazyByteStringCopylazyByteStringInsert byteStringlazyByteStringuntrimmedStrategy safeStrategytoLazyByteStringWithchar7int8Decint16Decint32Decint64DecintDecword8Dec word16Dec word32Dec word64DecwordDecword8Hex word16Hex word32Hex word64HexwordHex word8HexFixedword16HexFixedword32HexFixedword64HexFixed int8HexFixed int16HexFixed int32HexFixed int64HexFixed floatHexFixeddoubleHexFixed primFixedprimMapListFixedprimUnfoldrFixedprimMapByteStringFixedprimMapLazyByteStringFixed primBoundedprimMapListBoundedprimUnfoldrBoundedprimMapByteStringBoundedprimMapLazyByteStringBoundedchar8charUtf8 integerDecfloatDec doubleDec byteStringHexlazyByteStringHextoLazyByteString hPutBuilderstring7string8 stringUtf8NextChunkMoreDone BufferWriter runBuildershiftr_wghc-prim GHC.TypesWord shiftr_w16baseGHC.WordWord16 shiftr_w32Word32 shiftr_w64Word64caseWordSize_32_64SizeMonoidal ContravariantsizepairF contramapFtoB sizeBound contramapBpairB Data.EitherEitherLeftRight Data.MaybemaybeBEFEpair contramap fixedEncodingrunF storableToFboundedEncodingrunB$fMonoidalBoundedPrim$fMonoidalFixedPrim$fContravariantBoundedPrim$fContravariantFixedPrimencodeFloatViaWord32FFloatencodeDoubleViaWord64FDoubleGHC.IntInt16Int32Int64IntnullForeignPtrfromForeignPtr toForeignPtr unsafeCreateunsafeCreateUptoN createAndTrimcreate createUptoN createUptoN'mallocByteStringeqw2cWord8Charc2w isSpaceWord8 isSpaceChar8inlinePerformIOPSc_count c_minimum c_maximum c_intersperse c_reversec_memsetc_memcpyc_memcmpc_memchrc_free_finalizerc_strlen packBytes packCharsunsafePackLenBytesunsafePackLenCharspackUptoLenBytespackUptoLenChars unpackBytes unpackCharsunpackAppendBytesLazyunpackAppendCharsLazyunpackAppendBytesStrictunpackAppendCharsStrictunsafeCreateUptoN'createAndTrim' compareBytesmemchrmemcmpmemcpymemset$fDataByteString$fIsStringByteString$fReadByteString$fShowByteString$fNFDataByteString$fMonoidByteString$fOrdByteString$fEqByteStringGHC.ListGHC.PrimAddr#NothingJust GHC.ClassesnotspanByteintercalateWithByteTruezipWith'GHC.IO.Handle.TypesHandleGHC.BaseStringGHC.IO.Handle.TexthGetBuffindIndexOrEndwithPtr unpackFoldrmkPSmkBigPSillegalBufferSizeerrorEmptyList moduleError moduleErrorIOmoduleErrorMsgfindFromEndUntil breakChar breakSpace dropSpace firstspace firstnonspace invariantEmptycheckInvariantchunk chunkOverheadcmp hGetContentsNhGetNhGetNonBlockingNrevNonEmptyChunks revChunks ChunkIOStreamIOPut putBuilderfromPut Data.MonoidMonoidmemptymappend BuildSignal BuildStepdone bufferFull insertChunks BufferRangefillWithBuildStepbuilderrunBuilderWithputrunPut ensureFree bytesCopyStepmaximalCopySizelazyByteStringCLazyByteStringCsanitizeYieldCYield1FinishedunPut InsertChunks BufferFull showBuilderbyteStringCopyStepciosToLazyByteStringbuildStepToCIOS $fMonadPut$fApplicativePut $fFunctorPut $fShowBuilder$fMonoidBuilder EncodingTable lowerTable encode4_as_8encode8_as_16h tableFromListbase16EncodingTable lowerAlphabetInt8c_long_long_uint_hex c_uint_hexc_long_long_uint_dec c_uint_decc_long_long_int_dec c_int_decencodeIntDecimalencodeWordDecimal encodeWordHex Data.ListencodeCharUtf8 integer-gmpGHC.Integer.TypeInteger