h"m@      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                                                                                  02010-2011 Simon Meier, 2010 Jasper van der JeugtBSD3-style (see LICENSE) Simon Meier unstable, privateGHCUnsafe  bytestringA builder primitive that always results in sequence of bytes that is no longer than a pre-determined bound. bytestringA builder primitive that always results in a sequence of bytes of a pre-determined, fixed size. bytestring0The type used for sizes and sizeBounds of sizes. bytestring6Type-constructors supporting lifting of type-products. bytestring!Contravariant functors as in the  contravariant package. bytestringA fmap-like operator for builder primitives, both bounded and fixed size.Builder primitives are contravariant so it's like the normal fmap, but 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 >*< char7Note that the rather verbose syntax for composition stems from the requirement to be able to compute the size / size bound at compile time. bytestringA pairing/concatenation operator for builder primitives, both bounded and fixed size. For example, ?toLazyByteString (primFixed (char7 >*< char7) ('x','y')) = "xy")We can combine multiple primitives using  multiple times. toLazyByteString (primFixed (char7 >*< char7 >*< char7) ('x',('y','z'))) = "xyz" bytestring5The size of the sequences of bytes generated by this . bytestringThe 1 that always results in the zero-length sequence.  bytestringEncode a pair by encoding its first component and then its second component.  bytestringChange 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 contramapF f . contramapF g = contramapF (g . f)  bytestring Convert a  to a .  bytestringLift a  to a . bytestring>The bound on the size of sequences of bytes generated by this . bytestring 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 contramapB f . contramapB g = contramapB (g . f) bytestringThe 1 that always results in the zero-length sequence. bytestringEncode a pair by encoding its first component and then its second component. bytestring 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, maybeB :: BoundedPrim () -> BoundedPrim a -> BoundedPrim (Maybe a) maybeB nothing just =  (Left ()) Right  eitherB nothing just  bytestringConditionally select a . For example, we can implement the ASCII primitive that drops characters with Unicode codepoints above 127 as follows. charASCIIDrop =  (< '\128') (fromF char7)     45(c) 2010 Simon MeierBSD3-style (see LICENSE) Simon Meier  experimentalGHC Trustworthy bytestring Encode a  using a  encoding. PRE: The / encoding must have a size of at least 4 bytes. bytestring Encode a  using a  encoding. PRE: The / encoding must have a size of at least 8 bytes.(c) 2010 Simon Meier Original serialization code from 'Data.Binary.Builder': (c) Lennart Kolmodin, Ross PattersonBSD3-style (see LICENSE) Simon Meier GHCUnsafe, bytestringRight-shift of a . bytestringRight-shift of a . bytestringRight-shift of a . bytestringRight-shift of a . bytestring6Select an implementation depending on the bit-size of s. Currently, it produces a runtime failure if the bitsize is different. This is detected by the testsuite.(c) 2010-2011 Simon MeierBSD3-style (see LICENSE) Simon Meier GHC Trustworthy(  bytestring%Encoding single unsigned bytes as-is. bytestring Encoding s in big endian format. bytestring Encoding s in little endian format. bytestring Encoding s in big endian format. bytestring Encoding s in little endian format. bytestring Encoding s in big endian format.  bytestring Encoding s in little endian format.! bytestringEncode a single native machine . The s is encoded in host order, host endian form, for the machine you are on. On a 64 bit machine the  is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way are not portable to different endian or word sized machines, without conversion." bytestring Encoding +s in native host order and host endianness.# bytestring Encoding +s in native host order and host endianness.$ bytestring Encoding +s in native host order and host endianness.% bytestring#Encoding single signed bytes as-is.& bytestring Encoding s in big endian format.' bytestring Encoding s in little endian format.( bytestring Encoding s in big endian format.) bytestring Encoding s in little endian format.* bytestring Encoding s in big endian format.+ bytestring Encoding s in little endian format., bytestringEncode a single native machine . The s is encoded in host order, host endian form, for the machine you are on. On a 64 bit machine the  is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way are not portable to different endian or integer sized machines, without conversion.- bytestring Encoding +s in native host order and host endianness.. bytestring Encoding +s in native host order and host endianness./ bytestring Encoding +s in native host order and host endianness.0 bytestring Encode a  in big endian format.1 bytestring Encode a  in little endian format.2 bytestring Encode a  in big endian format.3 bytestring Encode a  in little endian format.4 bytestring Encode a  in native host order and host endianness. Values written this way are not portable to different endian machines, without conversion.5 bytestring Encode a * in native host order and host endianness. !"#$%&'()*+,-./012345(c) Don Stewart 2006-2008 (c) Duncan Coutts 2006-2012 BSD-style.dons00@gmail.com, duncan@community.haskell.orgunstable non-portableUnsafe 3:6 bytestring&A space-efficient representation of a / vector, supporting many efficient operations.A 68 contains 8-bit bytes, or by using the operations from Data.ByteString.Char87 it can be interpreted as containing 8-bit characters.C bytestringO(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# is with an unboxed string literal, than to pack a boxed string. A unboxed string literal is compiled to a static char [] 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 unsafePackAddressLen2 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# this modification will be reflected in the resulting  ByteString$, breaking referential transparency.5Note this also won't work if your Addr# has embedded '\0' characters in the string, as strlen will return too short a length.L bytestring5The 0 pointer. Used to indicate the empty Bytestring.M bytestringO(1)& Build a ByteString from a ForeignPtr.If you do not need the offset parameter then you do should be using  or  instead.N bytestringO(1)+ Deconstruct a ForeignPtr from a ByteStringO bytestring8A way of creating ByteStrings outside the IO monad. The Int2 argument gives the final size of the ByteString.P bytestringLike O but instead of giving the final size of the ByteString, it is just an upper bound. The inner action returns the actual size. Unlike S the ByteString is not reallocated if the final size is less than the estimated size.Q bytestringCreate ByteString of size l and use action f to fill it's contents.R bytestring%Create ByteString of up to size size l and use action f4 to fill it's contents which returns its true size. bytestring Create ByteString of up to size l and use action f3 to fill it's contents which returns its true size.S bytestringGiven the maximum size needed and a function to make the contents of a ByteString, createAndTrim makes the 6. The generating function is required to return the actual final size (<= the maximum size), and the resulting byte array is realloced to this size.createAndTrim is the main mechanism for creating custom, efficient ByteString functions, using Haskell or C functions to fill the space.U bytestring Wrapper of mallocForeignPtrBytes# with faster implementation for GHC bytestring still neededV bytestring5Add two non-negative numbers. Errors out on overflow.W bytestringConversion between  and . Should compile to a no-op.X bytestringUnsafe conversion between  and <. This is a no-op and silently truncates to 8 bits Chars > '\255'=. It is provided as convenience for ByteString construction.Y bytestringSelects words corresponding to white-space characters in the Latin-1 range ordered by frequency.Z bytestring3Selects white-space characters in the Latin-1 range[ bytestring0This "function" has a superficial similarity to unsafePerformIO but it is in fact a malevolent agent of chaos. It unpicks the seams of reality (and the  monad) so that the normal rules no longer apply. It lulls you into thinking it is reasonable, but when you are not looking it stabs you in the back and aliases all of your mutable buffers. The carcass of many a seasoned Haskell programmer lie strewn at its feet.!Witness the trail of destruction: https://github.com/haskell/bytestring/commit/71c4b438c675aa360c79d79acc9a491e7bbc26e7 https://github.com/haskell/bytestring/commit/210c656390ae617d9ee3b8bcff5c88dd17cef8da ,https://ghc.haskell.org/trac/ghc/ticket/3486 ,https://ghc.haskell.org/trac/ghc/ticket/3487 ,https://ghc.haskell.org/trac/ghc/ticket/72707Do not talk about "safe"! You do not know what is safe!Yield not to its blasphemous call! Flee traveller! Flee or you will be corrupted and devoured!M bytestringOffset bytestringLengthN bytestring(ptr, offset, length)+6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`+67?DA@EBFHJGIKCQRSTOPUMNLV>=]^_`<;:98WXYZ[\(c) Duncan Coutts 2012-2013 BSD-styleduncan@community.haskell.orgstableghc onlyUnsafe 3E j bytestringA compact representation of a  vector.&It has a lower memory overhead than a 6 and and does not contribute to heap fragmentation. It can be converted to or from a 6 (at the cost of copying the string data). It supports very few other operations.It is suitable for use as an internal representation for code that needs to keep many short strings in memory, but it  should not be used as an interchange type. That is, it should not generally be used in public APIs. The 6 type is usually more suitable for use in interfaces; it is more flexible and it supports a wide range of operations.l bytestringO(1) . The empty j.m bytestringO(1) The length of a j.n bytestringO(1) Test whether a j is empty.o bytestringO(1) j. index (subscript) operator, starting from 0. q bytestringO(n) . Convert a 6 into a j.7This makes a copy, so does not retain the input string.r bytestringO(n) . Convert a j into a 6.s bytestringO(n). Convert a list into a jt bytestringO(n) . Convert a j into a list.w  bytestringO(n). Construct a new ShortByteString from a CString. The resulting ShortByteString' is an immutable copy of the original CString4, and is managed on the Haskell heap. The original CString must be null terminated.x  bytestringO(n). Construct a new ShortByteString from a  CStringLen. The resulting ShortByteString& is an immutable copy of the original  CStringLen. The ShortByteString is a normal Haskell value and will be managed on the Haskell heap.y  bytestringO(n) construction. Use a ShortByteString. with a function requiring a null-terminated CString. The CString is a copy and will be freed automatically; it must not be stored or used after the subcomputation finishes.z  bytestringO(n) construction. Use a ShortByteString with a function requiring a  CStringLen . As for  useAsCString, this function makes a copy of the original ShortByteString. It must not be stored or used after the subcomputation finishes.u bytestring source data bytestringoffset into source bytestring destination bytestringnumber of bytes to copyv bytestring source data bytestringnumber of bytes to copyjklmnopqrstuvwxyzjkqrstlnmopvuwxyz(c) Duncan Coutts 2012-2013 BSD-styleduncan@community.haskell.orgstableghc only TrustworthyE jlmnoqrstwxyz jqrstlnmowxyz(c) Don Stewart 2006-2008 (c) Duncan Coutts 2006-2011 BSD-style.dons00@gmail.com, duncan@community.haskell.org provisional non-portableUnsafea bytestring A variety of  for non-empty ByteStrings.  omits the check for the empty case, so there is an obligation on the programmer to provide a proof that the ByteString is non-empty. bytestring 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. bytestring 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. bytestring 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. bytestringUnsafe 6: index (subscript) operator, starting from 0, returning a  This omits the bounds check, which means there is an accompanying obligation on the programmer to ensure the bounds are checked in some other way. bytestring A variety of  which omits the checks on n so there is an obligation on the programmer to provide a proof that  0 <= n <=  xs. bytestring A variety of  which omits the checks on n so there is an obligation on the programmer to provide a proof that  0 <= n <=  xs. bytestringO(1) ) provides constant-time construction of 6s, which is ideal for string literals. It packs a sequence of bytes into a  ByteString, given a raw . 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 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 this function. bytestringO(1) Construct a 6 given a Ptr Word8 to a buffer, a 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 transparency by modifying the underlying buffer pointed to by the first argument. Any changes to the original buffer will be reflected in the resulting  ByteString. bytestring/Explicitly run the finaliser associated with a 6. References to this value after finalisation may generate invalid memory references.This function is unsafe, as there may be other  ByteStrings referring to the same underlying pages. If you use this, you need to have a proof of some kind that all 6s ever generated from the underlying byte array are no longer live. bytestringO(n) Build a  ByteString from a CString. This value will have no finalizer associated to it, and will not be garbage collected by 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. bytestringO(1) Build a  ByteString from a  CStringLen. This value will have no finalizer associated with it, and will not be garbage collected by Haskell. This operation has O(1)6 complexity as we already know the final size, so no  strlen(3) is required.This function is unsafe. If the original  CStringLen is later modified, this change will be reflected in the resulting  ByteString%, breaking referential transparency. bytestringO(n) Build a  ByteString from a malloced CString. This value will have a free(3) finalizer associated to it.This function 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 free8 error, or if you pass it a CString not allocated with malloc. bytestringO(1) Build a  ByteString from a malloced  CStringLen. This value will have a free(3) finalizer associated to it.This function 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 free8 error, or if you pass it a CString not allocated with malloc. bytestringO(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 CString6 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  ByteString6 to change, breaking referential transparency. Other  ByteStrings0 created by sharing (such as those produced via  or 1) will also reflect these changes. Modifying the CString; will break referential transparency. To avoid this, use  useAsCString%, which makes a copy of the original  ByteString.CStrings 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.The memory may freed at any point after the subcomputation terminates, so the pointer to the storage must *not* be used after this. bytestringO(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  CStringLen6 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  ByteString6 to change, breaking referential transparency. Other  ByteStrings0 created by sharing (such as those produced via  or 1) will also reflect these changes. Modifying the  CStringLen; will break referential transparency. To avoid this, use useAsCStringLen%, which makes a copy of the original  ByteString.CC(c) The University of Glasgow 2001, (c) David Roundy 2003-2005, (c) Simon Marlow 2005, (c) Bjorn Bringert 2006, (c) Don Stewart 2005-2008, (c) Duncan Coutts 2006-2013 BSD-style.dons00@gmail.com, duncan@community.haskell.orgstableportable Trustworthy% bytestringO(1) The empty 6 bytestringO(1) Convert a  into a 6 bytestringO(n) Convert a [] into a 6.For applications with large numbers of string literals, pack can be a bottleneck. In such cases, consider using packAddress (GHC only). bytestringO(n) Converts a 6 to a []. bytestringO(1)$ Test whether a ByteString is empty. bytestringO(1) * returns the length of a ByteString as an . bytestringO(n)  is analogous to (:) for lists, but of different complexity, as it requires making a copy. bytestringO(n) Append a byte to the end of a 6 bytestringO(1) Extract the first element of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString. bytestringO(1) Extract the elements after the head of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString. bytestringO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty. bytestringO(1) Extract the last element of a ByteString, which must be finite and non-empty. An exception will be thrown in the case of an empty ByteString. bytestringO(1) Return all the elements of a 6 except the last one. An exception will be thrown in the case of an empty ByteString. bytestringO(1) Extract the  and 4 of a ByteString, returning Nothing if it is empty. bytestringO(n) Append two ByteStrings bytestringO(n)  f xs( is the ByteString obtained by applying f to each element of xs. bytestringO(n)  xs% efficiently returns the elements of xs in reverse order. bytestringO(n) The  function takes a  and a 6; and `intersperses' that byte between the elements of the 69. It is analogous to the intersperse function on Lists. bytestringThe 2 function transposes the rows and columns of its 6 argument. bytestring, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. bytestring is like  , but strict in the accumulator. bytestring, applied to a binary operator, a starting value (typically the right-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from right to left. bytestring is like  , but strict in the accumulator. bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty  ByteStrings. An exception will be thrown in the case of an empty ByteString. bytestring is like , but strict in the accumulator. An exception will be thrown in the case of an empty ByteString. bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty 6s An exception will be thrown in the case of an empty ByteString. bytestring is a variant of $, but is strict in the accumulator. bytestringO(n)# Concatenate a list of ByteStrings. bytestringMap a function over a 6 and concatenate the results bytestringO(n)* Applied to a predicate and a ByteString, # determines if any element of the 6 satisfies the predicate. bytestringO(n) Applied to a predicate and a 6, $ determines if all elements of the 6 satisfy the predicate. bytestringO(n) " returns the maximum value from a 6 This function will fuse. An exception will be thrown in the case of an empty ByteString. bytestringO(n) " returns the minimum value from a 6 This function will fuse. An exception will be thrown in the case of an empty ByteString. bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list. bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString. bytestring is similar to , but returns a list of successive reduced values from the left. This function will fuse. 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. bytestring is a variant of ? that has no starting value argument. This function will fuse. .scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] bytestring)scanr is the right-to-left dual of scanl. bytestring is a variant of % that has no starting value argument. bytestringO(n)  n x is a ByteString of length n with x2 the value of every element. The following holds: .replicate w c = unfoldr w (\u -> Just (u,u)) cThis implemenation uses  memset(3) bytestringO(n), where n# is the length of the result. The 0 function is analogous to the List 'unfoldr'.  builds a ByteString from a seed value. The function takes the element and returns 4 if it is done producing the ByteString or returns  (a,b), in which case, a& is the next byte in the string, and b* is the seed value for further production. Examples:  unfoldr (\x -> if x <= 5 then Just (x, x + 1) else Nothing) 0 == pack [0, 1, 2, 3, 4, 5] bytestringO(n) Like ,  builds a ByteString from a seed 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) bytestringO(1)  n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n >  xs. bytestringO(1)  n xs returns the suffix of xs after the first n elements, or [] if n >  xs. bytestringO(1)  n xs is equivalent to ( n xs,  n xs). bytestring, applied to a predicate p and a ByteString xs2, returns the longest prefix (possibly empty) of xs of elements that satisfy p. bytestring p xs$ returns the suffix remaining after  p xs. bytestring p is equivalent to  ( . p).Under GHC, a rewrite rule will transform break (==) into a call to the specialised breakByte: 6break ((==) x) = breakByte x break (==x) = breakByte x bytestring breaks its ByteString argument at the first occurence of the specified byte. It is more efficient than  as it is implemented with  memchr(3). I.e. ,break (=='c') "abcd" == breakByte 'c' "abcd" bytestring behaves like  but from the end of the 6breakEnd p == spanEnd (not.p) bytestring p xs? breaks the ByteString into two segments. It is equivalent to ( p xs,  p xs) bytestring breaks its ByteString argument at the first occurence of a byte other than its argument. It is more efficient than 'span (==)' +span (=='c') "abcd" == spanByte 'c' "abcd" bytestring behaves like  but from the end of the 6 . We have -spanEnd (not.isSpace) "x y z" == ("x y ","z")and spanEnd (not . isSpace) ps == let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x) bytestringO(n) Splits a 6 into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg. splitWith (=='a') "aabbaca" == ["","","bb","c",""] splitWith (=='a') [] == [] bytestringO(n) Break a 6 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 9intercalate [c] . split c == id split == splitWith . (==)As for all splitting functions in this library, this function does not copy the substrings, it just constructs new  ByteStrings" that are slices of the original. bytestringThe  function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the 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. It is about 40% faster than  groupBy (==) bytestringThe + function is the non-overloaded version of . bytestringO(n) The  function takes a 6 and a list of 6s and concatenates the list after interspersing the first argument between each element of the list. bytestringO(n) intercalateWithByte. An efficient way to join to two ByteStrings with a char. Around 4 times faster than the generalised join. bytestringO(1) 6- index (subscript) operator, starting from 0. bytestringO(n) The ? function returns the index of the first element in the given 6* which is equal to the query element, or  if there is no such element. This implementation uses memchr(3). bytestringO(n) The > function returns the last index of the element in the given 6* which is equal to the query element, or 3 if there is no such element. The following holds: elemIndexEnd c xs == (-) (length xs - 1) `fmap` elemIndex c (reverse xs) bytestringO(n) The  function extends , by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3). bytestringcount returns the number of times its argument appears in the ByteString count = length . elemIndicesBut more efficiently than using length on the intermediate list. bytestringThe " function takes a predicate and a 6 and returns the index of the first element in the ByteString satisfying the predicate. bytestringThe  function extends , by returning the indices of all elements satisfying the predicate, in ascending order. bytestringO(n)  is the 6 membership predicate. bytestringO(n)  is the inverse of  bytestringO(n) , applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. bytestringO(n) The  function takes a predicate and a ByteString, and returns the first element in matching the predicate, or  if there is no such element. find f p = case findIndex f p of Just n -> Just (p ! n) ; _ -> Nothing bytestringO(n) The  function takes a predicate a ByteString and returns the pair of ByteStrings with elements which do and do not satisfy the predicate, respectively; i.e., 4partition p bs == (filter p xs, filter (not . p) xs) bytestringO(n) The , function takes two ByteStrings and returns ) if the first is a prefix of the second.  bytestringO(n) The , function takes two ByteStrings and returns  the remainder of the second iff the first is its prefix, and otherwise . bytestringO(n) The , function takes two ByteStrings and returns * iff the first is a suffix of the second.The following holds: 2isSuffixOf x y == reverse x `isPrefixOf` reverse yHowever, the real implemenation uses memcmp to compare the end of the string only, with no reverse required.. bytestringO(n) The , function takes two ByteStrings and returns  the remainder of the second iff the first is its suffix, and otherwise . bytestring4Check whether one string is a substring of another. isInfixOf p s is equivalent to not (null (findSubstrings p s)). bytestringBreak a string on a substring, returning a pair of the part of the string prior to the match, and the rest of the string.!The following relationships hold: 0break (== c) l == breakSubstring (singleton c) land: findSubstring s l == if null s then Just 0 else case breakSubstring s l of (x,y) | null y -> Nothing | otherwise -> Just (length x)7For example, to tokenise a string, dropping delimiters: 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)1To take the parts of a string before a delimiter: fst (breakSubstring x y)Note that calling `breakSubstring x` does some preprocessing work, so you should avoid unnecessarily duplicating breakSubstring calls with the same pattern. bytestring half of available memory, this may lead to memory exhaustion. Consider using  in this case.The Handle is closed once the contents have been read, or if an exception is thrown. bytestringgetContents. Read stdin strictly. Equivalent to hGetContents stdin The - is closed after the contents have been read. bytestring/The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. bytestring$Read an entire file strictly into a 6. bytestringWrite a 6 to a file. bytestring Append a 6 to a file. bytestring is a variant of findIndex, that returns the length of the string if no element is found, rather than Nothing. bytestringString to search for bytestringString to search in bytestring+Head and tail of string broken at substring bytestringString to search for. bytestringString to seach in. bytestringString to search for. bytestringString to seach in. bytestringfirst read size bytestringinitial buffer size increment6655 (c) Don Stewart 2006-2008 (c) Duncan Coutts 2006-2011 BSD-style.dons00@gmail.com, duncan@community.haskell.orgunstable non-portableUnsafe3  bytestring&A space-efficient representation of a / vector, supporting many efficient operations.A lazy 8 contains 8-bit bytes, or by using the operations from Data.ByteString.Lazy.Char87 it can be interpreted as containing 8-bit characters. bytestring5The data type invariant: Every ByteString is either  or consists of non-null 6s. All functions must preserve this, and the QC properties must check this. bytestring+In a form that checks the invariant lazily. bytestringSmart constructor for %. Guarantees the data type invariant. bytestringConsume the chunks of a lazy ByteString with a natural right fold. bytestringConsume the chunks of a lazy ByteString with a strict, tail-recursive, accumulating left fold. bytestringThe chunk size used for I/O. Currently set to 32k, less the memory management overhead bytestringThe recommended chunk size. Currently set to 4k, less the memory management overhead bytestringThe memory management overhead. Currently this is tuned for GHC only.?(c) Don Stewart 2006 (c) Duncan Coutts 2006-2011 BSD-style.dons00@gmail.com, duncan@community.haskell.orgstableportable Trustworthy6 bytestringO(1) The empty  bytestringO(1) Convert a  into a  bytestringO(n) Convert a '[Word8]' into a . bytestringO(n) Converts a  to a '[Word8]'. bytestringO(c) Convert a list of strict  into a lazy  bytestringO(c) Convert a lazy  into a list of strict  bytestringO(1) Convert a strict  into a lazy . bytestringO(n) Convert a lazy  into a strict .Note that this is an  expensive operation that forces the whole lazy ByteString into memory and then copies all the data. If possible, try to avoid converting back and forth between strict and lazy bytestrings. bytestringO(1)$ Test whether a ByteString is empty. bytestringO(n/c) * returns the length of a ByteString as an  bytestringO(1) ! is analogous to '(:)' for lists. bytestringO(1) Unlike ,  is strict in the ByteString that we are consing onto. More precisely, it forces 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 xsYou can however use  , as well as  and &, to build infinite lazy ByteStrings. bytestringO(n/c) Append a byte to the end of a  bytestringO(1) Extract the first element of a ByteString, which must be non-empty. bytestringO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty. bytestringO(1) Extract the elements after the head of a ByteString, which must be non-empty. bytestringO(n/c) Extract the last element of a ByteString, which must be finite and non-empty. bytestringO(n/c) Return all the elements of a  except the last one. bytestringO(n/c) Extract the  and 4 of a ByteString, returning Nothing if it is empty.It is no faster than using  and  bytestringO(n/c) Append two ByteStrings bytestringO(n)  f xs( is the ByteString obtained by applying f to each element of xs. bytestringO(n)  xs returns the elements of xs in reverse order. bytestringThe  function takes a  and a ; and `intersperses' that byte between the elements of the 8. It is analogous to the intersperse function on Lists. bytestringThe 2 function transposes the rows and columns of its  argument. bytestring, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. bytestring is like  , but strict in the accumulator. bytestring, applied to a binary operator, a starting value (typically the right-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from right to left. bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty  ByteStrings. bytestring is like  , but strict in the accumulator. bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty s bytestringO(n)# Concatenate a list of ByteStrings. bytestringMap a function over a  and concatenate the results bytestringO(n)* Applied to a predicate and a ByteString, # determines if any element of the  satisfies the predicate. bytestringO(n) Applied to a predicate and a , $ determines if all elements of the  satisfy the predicate. bytestringO(n) " returns the maximum value from a  bytestringO(n) " returns the minimum value from a  bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString. bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString. bytestring is similar to , but returns a list of successive reduced values from the left. This function will fuse. 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. bytestring f x= returns an infinite ByteString of repeated applications of f to x: %iterate f x == [x, f x, f (f x), ...] bytestring x! is an infinite ByteString, with x the value of every element. bytestringO(n)  n x is a ByteString of length n with x the value of every element. bytestring ties a finite ByteString into a circular one, or equivalently, the infinite repetition of the original ByteString. bytestringO(n) The / function is analogous to the List 'unfoldr'.  builds a ByteString from a seed value. The function takes the element and returns 4 if it is done producing the ByteString or returns  (a,b), in which case, a( is a prepending to the ByteString and b2 is used as the next element in a recursive call. bytestringO(n/c)  n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n >  xs. bytestringO(n/c)  n xs returns the suffix of xs after the first n elements, or [] if n >  xs. bytestringO(n/c)  n xs is equivalent to ( n xs,  n xs). bytestring, applied to a predicate p and a ByteString xs2, returns the longest prefix (possibly empty) of xs of elements that satisfy p. bytestring p xs$ returns the suffix remaining after  p xs. bytestring p is equivalent to  ( . p). bytestring p xs? breaks the ByteString into two segments. It is equivalent to ( p xs,  p xs) bytestringO(n) Splits a  into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg. splitWith (=='a') "aabbaca" == ["","","bb","c",""] splitWith (=='a') [] == [] bytestringO(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 9intercalate [c] . split c == id split == splitWith . (==)As for all splitting functions in this library, this function does not copy the substrings, it just constructs new  ByteStrings" that are slices of the original. bytestringThe  function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the 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. bytestringThe + function is the non-overloaded version of . bytestringO(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. bytestringO(c) - index (subscript) operator, starting from 0. bytestringO(n) The ? function returns the index of the first element in the given * which is equal to the query element, or  if there is no such element. This implementation uses memchr(3).  bytestringO(n) The > function returns the last index of the element in the given * which is equal to the query element, or 3 if there is no such element. The following holds: elemIndexEnd c xs == (-) (length xs - 1) `fmap` elemIndex c (reverse xs) bytestringO(n) The  function extends , by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3). bytestringcount returns the number of times its argument appears in the ByteString count = length . elemIndicesBut more efficiently than using length on the intermediate list. bytestringThe " function takes a predicate and a  and returns the index of the first element in the ByteString satisfying the predicate. bytestringO(n) The  function takes a predicate and a ByteString, and returns the first element in matching the predicate, or  if there is no such element. find f p = case findIndex f p of Just n -> Just (p ! n) ; _ -> Nothing bytestringThe  function extends , by returning the indices of all elements satisfying the predicate, in ascending order. bytestringO(n)  is the  membership predicate. bytestringO(n)  is the inverse of  bytestringO(n) , applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. bytestringO(n) The  function takes a predicate a ByteString and returns the pair of ByteStrings with elements which do and do not satisfy the predicate, respectively; i.e., 4partition p bs == (filter p xs, filter (not . p) xs) bytestringO(n) The , function takes two ByteStrings and returns * iff the first is a prefix of the second.  bytestringO(n) The , function takes two ByteStrings and returns  the remainder of the second iff the first is its prefix, and otherwise . bytestringO(n) The , function takes two ByteStrings and returns * iff the first is a suffix of the second.The following holds: 2isSuffixOf x y == reverse x `isPrefixOf` reverse y bytestringO(n) The , function takes two ByteStrings and returns  the remainder of the second iff the first is its suffix, and otherwise . bytestringO(n)  takes two ByteStrings and returns a list of corresponding pairs of bytes. If one input ByteString is short, excess elements of the longer ByteString are discarded. This is equivalent to a pair of  operations. bytestring generalises  by zipping with the function given as the first argument, instead of a tupling function. For example,  (+) is applied to two ByteStrings to produce the list of corresponding sums. bytestringO(n)  transforms a list of pairs of bytes into a pair of ByteStrings. Note that this performs two  operations. bytestringO(n)* Return all initial segments of the given , shortest first. bytestringO(n)( Return all final segments of the given , longest first. bytestringO(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 if a large string has been read in, and only a small part of it is needed in the rest of the program. bytestringRead entire handle contents lazily into a ). Chunks are read on demand, in at most k6-sized chunks. It does not block waiting for a whole k-sized chunk, so if less than k bytes are available then they will be returned immediately as a smaller chunk.The handle is closed on EOF. Note: the ' should be placed in binary mode with  for  to work correctly. bytestringRead n bytes into a , directly from the specified , in chunks of size k. bytestringhGetNonBlockingN is similar to , except that it will never block waiting for data to become available, instead it returns only whatever data is available. Chunks are read on demand, in k-sized chunks. bytestringRead entire handle contents lazily into a ;. Chunks are read on demand, using the default chunk size..Once EOF is encountered, the Handle is closed. Note: the ' should be placed in binary mode with  for  to work correctly. bytestringRead n bytes into a , directly from the specified . bytestringhGetNonBlocking is similar to , except that it will never block waiting for data to become available, instead it returns only whatever data is available. If there is no data available to be read,  returns .Note: on Windows and with Haskell implementation other than GHC, this function does not work correctly; it behaves identically to . bytestringRead an entire file lazily into a 9. The Handle will be held open until EOF is encountered. bytestringWrite a  to a file. bytestring Append a  to a file. bytestring9getContents. Equivalent to hGetContents stdin. Will read lazily bytestring Outputs a  to the specified . The chunks will be written one at a time. Other threads might write to the  between the writes, and hence 3 alone might not be suitable for concurrent writes. bytestring Similar to  except that it will never block. Instead it returns any tail that did not get written. This tail may be  in the case that the whole string was written, or the whole original string if nothing was written. Partial writes are also possible.Note: on Windows and with Haskell implementation other than GHC, this function does not work correctly; it behaves identically to . bytestringA synonym for hPut, for compatibility bytestringWrite a ByteString to stdout bytestring6Write a ByteString to stdout, appending a newline byte bytestring/The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. bytestring is a variant of findIndex, that returns the length of the string if no element is found, rather than Nothing.555 (c) Don Stewart 2006-2008 (c) Duncan Coutts 2006-2011 BSD-style.dons00@gmail.com, duncan@community.haskell.orgstableportable Trustworthy9 bytestringO(1) Convert a  into a  bytestringO(n) Convert a  into a .  bytestringO(n) Converts a  to a . bytestringO(1) ! is analogous to '(:)' for lists. bytestringO(1) Unlike ,  is strict in the ByteString that we are consing onto. More precisely, it forces 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 xsYou can however use  , as well as  and &, to build infinite lazy ByteStrings. bytestringO(n) Append a Char to the end of a . Similar to ", this function performs a memcpy. bytestringO(1) Extract the first element of a ByteString, which must be non-empty. bytestringO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty. bytestringO(n/c) Extract the  and 4 of a ByteString, returning Nothing if it is empty. bytestringO(1) Extract the last element of a packed string, which must be non-empty. bytestringO(n)  f xs( is the ByteString obtained by applying f to each element of xs bytestringO(n) The  function takes a Char and a < and `intersperses' that Char between the elements of the 8. It is analogous to the intersperse function on Lists. bytestring, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. bytestring. is like foldl, but strict in the accumulator. bytestring, applied to a binary operator, a starting value (typically the right-identity of the operator), and a packed string, reduces the packed string using the binary operator, from right to left. bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty  ByteStrings. bytestring is like  , but strict in the accumulator. bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty s bytestringMap a function over a  and concatenate the results bytestring)Applied to a predicate and a ByteString, # determines if any element of the  satisfies the predicate. bytestringApplied to a predicate and a , $ determines if all elements of the  satisfy the predicate. bytestring" returns the maximum value from a  bytestring" returns the minimum value from a  bytestring is similar to , but returns a list of successive reduced values from the left. This function will fuse. 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. bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString. bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString. bytestring f x= returns an infinite ByteString of repeated applications of f to x: %iterate f x == [x, f x, f (f x), ...] bytestring x! is an infinite ByteString, with x the value of every element. bytestringO(n)  n x is a ByteString of length n with x the value of every element. bytestringO(n) The / function is analogous to the List 'unfoldr'.  builds a ByteString from a seed value. The function takes the element and returns 4 if it is done producing the ByteString or returns  (a,b), in which case, a( is a prepending to the ByteString and b2 is used as the next element in a recursive call. bytestring, applied to a predicate p and a ByteString xs2, returns the longest prefix (possibly empty) of xs of elements that satisfy p. bytestring p xs$ returns the suffix remaining after  p xs. bytestring p is equivalent to  ( . p). bytestring p xs? breaks the ByteString into two segments. It is equivalent to ( p xs,  p xs) bytestringO(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 9intercalate [c] . split c == id split == splitWith . (==)As for all splitting functions in this library, this function does not copy the substrings, it just constructs new  ByteStrings" that are slices of the original. bytestringO(n) Splits a  into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg. 2splitWith (=='a') "aabbaca" == ["","","bb","c",""] bytestringThe + function is the non-overloaded version of . bytestringO(1) - index (subscript) operator, starting from 0. bytestringO(n) The ? function returns the index of the first element in the given 6 which is equal (by memchr) to the query element, or  if there is no such element. bytestringO(n) The  function extends , by returning the indices of all elements equal to the query element, in ascending order. bytestringThe " function takes a predicate and a  and returns the index of the first element in the ByteString satisfying the predicate. bytestringThe  function extends , by returning the indices of all elements satisfying the predicate, in ascending order. bytestringcount returns the number of times its argument appears in the ByteString ?count == length . elemIndices count '\n' == length . linesBut more efficiently than using length on the intermediate list. bytestringO(n)  is the 1 membership predicate. This implementation uses  memchr(3). bytestringO(n)  is the inverse of  bytestringO(n) , applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. bytestringO(n) The  function takes a predicate and a ByteString, and returns the first element in matching the predicate, or  if there is no such element. bytestringO(n)  takes two ByteStrings and returns a list of corresponding pairs of Chars. If one input ByteString is short, excess elements of the longer ByteString are discarded. This is equivalent to a pair of  operations, and so space usage may be large for multi-megabyte ByteStrings bytestring generalises  by zipping with the function given as the first argument, instead of a tupling function. For example,  (+) is applied to two ByteStrings to produce the list of corresponding sums. bytestring 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. bytestring is an inverse operation to . It joins lines, after appending a terminating newline to each. bytestring breaks a ByteString up into a list of words, which were delimited by Chars representing white space. And tokens isSpace = words bytestringThe  function is analogous to the  function, on words. bytestringreadInt reads an Int from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. bytestringreadInteger reads an Integer from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. bytestring8Write a ByteString to a handle, appending a newline byte bytestring6Write a ByteString to stdout, appending a newline byte555 (c) Don Stewart 2006-2008 (c) Duncan Coutts 2006-2011 BSD-style.dons00@gmail.com, duncan@community.haskell.orgstableportable TrustworthyG{ bytestringO(1) Convert a  into a 6 bytestringO(n) Convert a  into a 6For applications with large numbers of string literals, pack can be a bottleneck. bytestringO(n) Converts a 6 to a . bytestringO(n)  is analogous to (:) for lists, but of different complexity, as it requires a memcpy. bytestringO(n) Append a Char to the end of a 6. Similar to ", this function performs a memcpy. bytestringO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty. bytestringO(1) Extract the  and 4 of a ByteString, returning Nothing if it is empty. bytestringO(1) Extract the first element of a ByteString, which must be non-empty. bytestringO(1) Extract the last element of a packed string, which must be non-empty. bytestringO(n)  f xs( is the ByteString obtained by applying f to each element of xs bytestringO(n) The  function takes a Char and a 6< and `intersperses' that Char between the elements of the 68. It is analogous to the intersperse function on Lists. bytestring, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. bytestring. is like foldl, but strict in the accumulator. bytestring, applied to a binary operator, a starting value (typically the right-identity of the operator), and a packed string, reduces the packed string using the binary operator, from right to left. bytestring is a strict variant of foldr bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty  ByteStrings. bytestringA strict version of  bytestring is a variant of  that has no starting value argument, and thus must be applied to non-empty 6s bytestringA strict variant of foldr1 bytestringMap a function over a 6 and concatenate the results bytestring)Applied to a predicate and a ByteString, # determines if any element of the 6 satisfies the predicate. bytestringApplied to a predicate and a 6, $ determines if all elements of the 6 satisfy the predicate. bytestring" returns the maximum value from a 6 bytestring" returns the minimum value from a 6 bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list. bytestringThe ( function behaves like a combination of  and ; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString. bytestring is similar to , but returns a list of successive reduced values from the left: 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. bytestring is a variant of % that has no starting value argument: .scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] bytestring)scanr is the right-to-left dual of scanl. bytestring is a variant of % that has no starting value argument. bytestringO(n)  n x is a ByteString of length n with x2 the value of every element. The following holds: .replicate w c = unfoldr w (\u -> Just (u,u)) cThis implemenation uses  memset(3) bytestringO(n), where n# is the length of the result. The 0 function is analogous to the List 'unfoldr'.  builds a ByteString from a seed value. The function takes the element and returns 4 if it is done producing the ByteString or returns  (a,b), in which case, a+ is the next character in the string, and b* is the seed value for further production. Examples: unfoldr (\x -> if x <= '9' then Just (x, succ x) else Nothing) '0' == "0123456789" bytestringO(n) Like ,  builds a ByteString from a seed 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) bytestring, applied to a predicate p and a ByteString xs2, returns the longest prefix (possibly empty) of xs of elements that satisfy p. bytestring p xs$ returns the suffix remaining after  p xs. bytestring p is equivalent to  ( . p). bytestring breaks its ByteString argument at the first occurence of the specified char. It is more efficient than  as it is implemented with  memchr(3). I.e. ,break (=='c') "abcd" == breakChar 'c' "abcd" bytestring p xs? breaks the ByteString into two segments. It is equivalent to ( p xs,  p xs) bytestring behaves like  but from the end of the 6 . We have -spanEnd (not.isSpace) "x y z" == ("x y ","z")and spanEnd (not . isSpace) ps == let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x) bytestring behaves like  but from the end of the 6breakEnd p == spanEnd (not.p) bytestringO(n) Break a 6 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 9intercalate [c] . split c == id split == splitWith . (==)As for all splitting functions in this library, this function does not copy the substrings, it just constructs new  ByteStrings" that are slices of the original. bytestringO(n) Splits a 6 into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg. 2splitWith (=='a') "aabbaca" == ["","","bb","c",""] bytestringThe + function is the non-overloaded version of . bytestringO(1) 6- index (subscript) operator, starting from 0. bytestringO(n) The ? function returns the index of the first element in the given 66 which is equal (by memchr) to the query element, or  if there is no such element. bytestringO(n) The > function returns the last index of the element in the given 6* which is equal to the query element, or 3 if there is no such element. The following holds: elemIndexEnd c xs == (-) (length xs - 1) `fmap` elemIndex c (reverse xs) bytestringO(n) The  function extends , by returning the indices of all elements equal to the query element, in ascending order. bytestringThe " function takes a predicate and a 6 and returns the index of the first element in the ByteString satisfying the predicate. bytestringThe  function extends , by returning the indices of all elements satisfying the predicate, in ascending order. bytestringcount returns the number of times its argument appears in the ByteString count = length . elemIndicesAlso count '\n' == length . linesBut more efficiently than using length on the intermediate list. bytestringO(n)  is the 61 membership predicate. This implementation uses  memchr(3). bytestringO(n)  is the inverse of  bytestringO(n) , applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. bytestringO(n) The  function takes a predicate and a ByteString, and returns the first element in matching the predicate, or  if there is no such element. bytestringO(n)  takes two ByteStrings and returns a list of corresponding pairs of Chars. If one input ByteString is short, excess elements of the longer ByteString are discarded. This is equivalent to a pair of  operations, and so space usage may be large for multi-megabyte ByteStrings bytestring generalises  by zipping with the function given as the first argument, instead of a tupling function. For example,  (+) is applied to two ByteStrings to produce the list of corresponding sums. bytestring transforms a list of pairs of Chars into a pair of ByteStrings. Note that this performs two  operations. bytestring A variety of  for non-empty ByteStrings.  omits the check for the empty case, which is good for performance, but there is an obligation on the programmer to provide a proof that the ByteString is non-empty. bytestring returns the pair of ByteStrings when the argument is broken at the first whitespace byte. I.e. break isSpace == breakSpace bytestring efficiently returns the 6 argument with white space Chars removed from the front. It is more efficient than calling dropWhile for removing whitespace. I.e. dropWhile isSpace == dropSpace bytestring breaks a ByteString up into a list of ByteStrings at newline Chars. The resulting strings do not contain newlines. bytestring is an inverse operation to . It joins lines, after appending a terminating newline to each. bytestring breaks a ByteString up into a list of words, which were delimited by Chars representing white space. bytestringThe  function is analogous to the  function, on words. bytestringreadInt reads an Int from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. bytestringreadInteger reads an Integer from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. bytestring8Write a ByteString to a handle, appending a newline byte bytestring6Write a ByteString to stdout, appending a newline byte6655(c) 2011 Simon MeierBSD3-style (see LICENSE) Simon Meier  experimentalGHC TrustworthyKA bytestring&An encoding table for Base16 encoding. bytestringThe encoding table for hexadecimal values with lower-case characters; e.g., deadbeef. bytestringEncode an octet as 16bit word comprising both encoded nibbles ordered according to the host endianness. Writing these 16bit to memory will write the nibbles in the correct order (i.e. big-endian).(c) 2010 Jasper Van der Jeugt (c) 2010 - 2011 Simon MeierBSD3-style (see LICENSE) Simon Meier GHC Trustworthy Qk bytestringEncode the least 7-bits of a  using the ASCII encoding. bytestringDecimal encoding of an . bytestringDecimal encoding of an . bytestringDecimal encoding of an . bytestringDecimal encoding of an . bytestringDecimal encoding of an . bytestringDecimal encoding of a . bytestringDecimal encoding of a . bytestringDecimal encoding of a . bytestringDecimal encoding of a . bytestringDecimal encoding of a . bytestringHexadecimal encoding of a . bytestringHexadecimal encoding of a . bytestringHexadecimal encoding of a . bytestringHexadecimal encoding of a . bytestringHexadecimal encoding of a . bytestring Encode a & using 2 nibbles (hexadecimal digits). bytestring Encode a  using 4 nibbles. bytestring Encode a  using 8 nibbles. bytestring Encode a  using 16 nibbles. bytestring Encode a & using 2 nibbles (hexadecimal digits). bytestring Encode a  using 4 nibbles. bytestring Encode a  using 8 nibbles. bytestring Encode a  using 16 nibbles. bytestringEncode an IEEE  using 8 nibbles. bytestringEncode an IEEE  using 16 nibbles. (c) 2010 - 2011 Simon MeierBSD3-style (see LICENSE) Simon Meier unstable, privateGHCUnsafe8 bytestring+A buffer allocation strategy for executing s. bytestringA  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 stream of bytes will always be written before the computed value is returned.s are a generalization of s. The typical use case is the implementation of an encoding that might fail (e.g., an interface to the zlib compression library or the conversion from Base64 encoded data to 8-bit data). For a , the only way to handle and report such a failure is ignore it or call . In contrast,  actions are expressive enough to allow reportng and handling such a failure in a pure fashion. () actions are isomorphic to s. The functions  and  convert between these two types. Where possible, you should use ;s, as sequencing them is slightly cheaper than sequencing 4s because they do not carry around a computed value. bytestring's denote sequences of bytes. They are  s where $ is the zero-length sequence and ! is concatenation, which runs in O(1). bytestring&s abstract signals to the caller of a . There are three signals: , , or 'insertChunks signals bytestrings may be called *multiple times* and they must not rise an async. exception. bytestring/A stream of chunks that are constructed in the  monad.This datatype serves as the common interface for the buffer-by-buffer execution of a  by '. Typical users of this interface are # or iteratee-style libraries like  enumerator. bytestring:The partially filled last buffer together with the result. bytestringYield a  non-empty strict 6. bytestringA  together with the  of free bytes. The filled space starts at offset 0 and ends at the first free byte. bytestringA range of bytes in a buffer represented by the pointer to the first byte of the range and the pointer to the first byte after the range. bytestring9Combined size of the filled and free space in the buffer. bytestring(Allocate a new buffer of the given size. bytestringConvert the filled part of a  to a strict 6. bytestringPrepend the filled part of a  to a lazy  trimming it if necessary. bytestringA smart constructor for yielding one chunk that ignores the chunk if it is empty. bytestring Convert a  () to a lazy  using . bytestring Convert a 0 to a lazy tuple of the result and the written  using . bytestringSignal that the current " is done and has computed a value. bytestring'Signal that the current buffer is full. bytestringSignal that a 6# chunk should be inserted directly. bytestringFill a  using a . bytestring Construct a . In contrast to s, !s are referentially transparent. bytestring&The final build step that returns the  signal. bytestringRun a  with the . bytestringRun a . bytestringThe  denoting a zero-length sequence of bytes. This function is only exported for use in rewriting rules. Use  otherwise. bytestringConcatenate two s. This function is only exported for use in rewriting rules. Use  otherwise. bytestring;Flush the current buffer. This introduces a chunk boundary. bytestring Construct a  action. In contrast to s, s are referentially transparent in the sense that sequencing the same  multiple times yields every time the same value with the same side-effect. bytestringRun a . bytestring Synonym for  from ; used in rewriting rules. bytestring Synonym for  from  and  from ; used in rewriting rules. bytestringRun a  as a side-effect of a  () action. bytestring Convert a  () action to a . bytestringRun a - action redirecting the produced output to a .!The output is buffered using the s associated buffer. If this buffer is too small to execute one step of the 9 action, then it is replaced with a large enough buffer. bytestring Execute a  and return the computed result and the bytes written during the computation as a lazy .This function is strict in the computed result and lazy in the writing of the bytes. For example, given infinitePut = sequence_ (repeat (putBuilder (word8 1))) >> return 0 evaluating the expression 'fst $ putToLazyByteString infinitePut 3does not terminate, while evaluating the expression 0L.head $ snd $ putToLazyByteString infinitePut $does terminate and yields the value  1 :: Word8.An illustrative example for these strictness properties is the implementation of Base64 decoding ( #http://en.wikipedia.org/wiki/Base64). *type DecodingState = ... decodeBase64 :: 6 -> DecodingState -> + (Maybe DecodingState) decodeBase64 = ... "The above function takes a strict 6 supposed to represent Base64 encoded data and the current decoding state. It writes the decoded bytes as the side-effect of the  and returns the new decoding state, if the decoding of all data in the 6- was successful. The checking if the strict 6 represents Base64 encoded data and the actual decoding are fused. This makes the common case, where all data represents Base64 encoded data, more efficient. It also implies that all data must be decoded before the final decoding state can be returned. s are intended for implementing such fused checking and decoding/encoding, which is reflected in their strictness properties. bytestring Execute a  with a buffer-allocation strategy and a continuation. For example,  is implemented as follows. putToLazyByteString =  (  ) (x -> (x, L.empty))  bytestringEnsure that there are at least n free bytes for the following . bytestringCopy the bytes from a  into the output stream. bytestring Construct a  that copies the strict 6s, if it is smaller than the treshold, and inserts it directly otherwise. For example, byteStringThreshold 1024 copies strict 6s whose size is less or equal to 1kb, and inserts them directly otherwise. This implies that the average chunk-size of the generated lazy  may be as low as 513 bytes, as there could always be just a single byte between the directly inserted 1025 byte, strict 6s. bytestring Construct a  that copies the strict 6.Use this function to create s from smallish (<= 4kb) 6's or if you need to guarantee that the 61 is not shared with the chunks generated by the . bytestring Construct a  that always inserts the strict 6 directly as a chunk.This implies flushing the output buffer, even if it contains just a single byte. You should therefore use  only for large (> 8kb) 6s. Otherwise, the generated chunks are too fragmented to be processed efficiently afterwards. bytestring Construct a  that copies the . bytestringCopy the bytes from a  into the output stream. bytestring Construct a ( that uses the thresholding strategy of  for each chunk of the lazy . bytestring Construct a  that copies the lazy . bytestring Construct a % that inserts all chunks of the lazy  directly. bytestring Create a 2 denoting the same sequence of bytes as a strict 6. The  inserts large 6s directly, but copies small ones to ensure that the generated chunks are large on average. bytestring Create a 0 denoting the same sequence of bytes as a lazy . The " inserts large chunks of the lazy  directly, but copies small ones to ensure that the generated chunks are large on average. bytestringThe maximal size of a 6 that is copied. 2 * - to guarantee that on average a chunk is of . bytestring6Create a custom allocation strategy. See the code for  and  for examples. bytestring>Sanitize a buffer size; i.e., make it at least the size of an . bytestring&Use this strategy for generating lazy s whose chunks are discarded right after they are generated. For example, if you just generate them to write them to a network socket. bytestring&Use this strategy for generating lazy s whose chunks are likely to survive one garbage collection. This strategy trims buffers that are filled less than half in order to avoid spilling too much memory. bytestringHeavy inlining. Execute a " with custom execution parameters.This function is inlined despite its heavy code-size to allow fusing with the allocation strategy. For example, the default  execution function toLazyByteString is defined as follows. {-# NOINLINE toLazyByteString #-} toLazyByteString = toLazyByteStringWith (   ) L.empty where L.empty is the zero-length lazy .&In most cases, the parameters used by toLazyByteString2 give good performance. A sub-performing case of toLazyByteString" is executing short (<128 bytes) s. In this case, the allocation overhead for the first 4kb buffer and the trimming cost dominate the cost of executing the ". You can avoid this problem using >toLazyByteStringWith (safeStrategy 128 smallChunkSize) L.emptyThis reduces the allocation and trimming overhead, as all generated s fit into the first buffer and there is no trimming required, if more than 64 bytes and less than 128 bytes are written. bytestring Convert a  to a  stream by executing it on #s allocated according to the given . bytestringNext free byte in current  bytestringComputed value bytestringMinimal size of next . bytestringNext free byte in current . bytestring to run on the next . This & may assume that it is called with a  of at least the required minimal size; i.e., the caller of this  must guarantee this. bytestringNext free byte in current  bytestringChunk to insert. bytestring to run on next  bytestring"Build step to use for filling the . bytestring Handling the  signal bytestring Handling the  signal bytestring Handling the  signal bytestringBuffer range to fill. bytestring"Value computed while filling this . bytestringA function that fills a +, calls the continuation with the updated = once its done, and signals its caller how to proceed using , , or .This function must be referentially transparent; i.e., calling it multiple times with equally sized s must result in the same sequence of bytes being written. If you need mutable state, then you must allocate it anew 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  is not guaranteed to be referentially transparent and sensitive data might leak. bytestring to run bytestring& that writes the byte stream of this  and signals  upon completion. bytestring to run bytestring Continuation  bytestringA 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  signals.This function must be referentially transparent; i.e., calling it multiple times with equally sized s must result in the same sequence of bytes being written and the same value being computed. If you need mutable state, then you must allocate it anew upon each call of this function. Moroever, this function must call the continuation once its done. Otherwise, monadic sequencing of s does not work. Finally, this 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. bytestring Put to run bytestring, that first writes the byte stream of this / and then yields the computed value using the  signal. bytestring to execute bytestringResult and lazy  written as its side-effect bytestring!Buffer allocation strategy to use bytestringContinuation to use for computing the final result and the tail of its side-effect (the written bytes). bytestring to execute bytestringResulting lazy  bytestringInput . bytestringInput . bytestringBuffer allocation function. If < is given, then a new first buffer should be allocated. If  (oldBuf, minSize), is given, then a buffer with minimal size minSize/ must be returned. The strategy may reuse the  oldBuffer?, if it can guarantee that this referentially transparent and  oldBuffer is large enough. bytestringDefault buffer size. bytestring A predicate trim used allocated returning 9, if the buffer should be trimmed before it is returned. bytestringSize of the first buffer bytestringSize of successive buffers bytestringAn allocation strategy that does not trim any of the filled buffers before converting it to a chunk bytestringSize of first buffer bytestringSize of successive buffers bytestringAn allocation strategy that guarantees that at least half of the allocated memory is used for live data bytestring!Buffer allocation strategy to use bytestringLazy + to use as the tail of the generated lazy  bytestring to execute bytestringResulting lazy  bytestring!Buffer allocation strategy to use bytestring to execute66(c) 2010-2011 Simon Meier (c) 2010 Jasper van der JeugtBSD3-style (see LICENSE) Simon Meier GHC Trustworthyu  bytestringEncode a value with a . bytestring2Encode a list of values from left-to-right with a . bytestring*Encode a list of values represented as an  with a . bytestringHeavy inlining. Encode all bytes of a strict 6 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 6 as shown by the  byteStringHex example above. bytestringHeavy inlining. Encode all bytes of a lazy  from left-to-right with a . bytestring Create a $ that encodes values with the given .We rewrite consecutive uses of 4 such that the bound-checks are fused. For example, 9primBounded (word32 c1) `mappend` primBounded (word32 c2)%is rewritten such that the resulting  checks only once, if ther are at 8 free bytes, instead of checking twice, if there are 4 free bytes. This optimization is not observationally equivalent in a strict sense, as it influences the boundaries of the generated chunks. However, for a user of this library it is observationally equivalent, as chunk boundaries of a lazy  can only be observed through the internal interface. Morevoer, we expect that all primitives write much fewer than 4kb (the default short buffer size). Hence, it is safe to ignore the additional memory spilled due to the more agressive buffer wrapping introduced by this optimization. bytestring Create a 6 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)9because it moves several variables out of the inner loop. bytestring Create a > that encodes a sequence generated from a seed value using a  for each sequence element. bytestring Create a  that encodes each  of a strict 6 using a . For example, we can write a  that filters a strict 6 as follows. >import Data.ByteString.Builder.Primas P (word8, condB, emptyB) 'filterBS p = P.condB p P.word8 P.emptyB bytestringChunk-wise application of . bytestringChar8 encode a . bytestringUTF-8 encode a . bytestringEncode a Unicode character to another datatype, using UTF-8. This function acts as an abstract way of encoding characters, as it is unaware of what needs to happen with the resulting bytes: you have to specify functions to deal with those. bytestring 1-byte UTF-8 bytestring 2-byte UTF-8 bytestring 3-byte UTF-8 bytestring 4-byte UTF-8 bytestringInput  bytestringResult  !"#$%&'()*+,-./012345 %&(*02')+ 13,-./!"#$45 (c) 2010 Jasper Van der Jeugt (c) 2010-2011 Simon MeierBSD3-style (see LICENSE) Simon Meier GHC Trustworthy bytestringAfter running a ; action there are three possibilities for what comes next: bytestringThis means we're all done. All the builder data has now been written. bytestringThis indicates that there may be more data to write. It gives you the next  action. You should call that action with an appropriate buffer. The int indicates the minimum# buffer size required by the next 3 action. That is, if you call the next action you must6 supply it with a buffer length of at least this size. bytestringIn addition to the data that has just been written into your buffer by the 9 action, it gives you a pre-existing chunk of data as a 6". It also gives you the following  action. It is safe to run this following action using a buffer with as much free space as was left by the previous run action. bytestringA $ represents the result of running a . 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.6a pre-existing chunks of data represented by a strict  ByteStringWhile this is rather low level, it provides you with full flexibility in how the data is written out.The  itself is an IO action: you supply it with a buffer (as a pointer and length) and it will write data into the buffer. It returns a number indicating how many bytes were actually written (which can be 0). It also returns a " which describes what comes next. bytestringTurn a  into its initial  action. bytestringEncode 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  is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way are not portable to different endian or int sized machines, without conversion. bytestring Encode a * in native host order and host endianness. bytestring Encode a * in native host order and host endianness. bytestring Encode a * in native host order and host endianness. bytestringEncode 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  is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way are not portable to different endian or word sized machines, without conversion. bytestring Encode a * in native host order and host endianness. bytestring Encode a * in native host order and host endianness. bytestring Encode a * in native host order and host endianness. bytestring Encode a  in native host order. Values encoded this way are not portable to different endian machines, without conversion. bytestring Encode a  in native host order. Safe-InferredM(c) 2010 - 2011 Simon MeierBSD3-style (see LICENSE) Simon Meier GHC Trustworthy   bytestring Encode a  using . bytestringDecimal encoding of an  using the ASCII digits.e.g. toLazyByteString (int8Dec 42) = "42" toLazyByteString (int8Dec (-1)) = "-1" bytestringDecimal encoding of an  using the ASCII digits. bytestringDecimal encoding of an  using the ASCII digits. bytestringDecimal encoding of an  using the ASCII digits. bytestringDecimal encoding of an  using the ASCII digits. bytestringDecimal encoding of a  using the ASCII digits. bytestringDecimal encoding of a  using the ASCII digits. bytestringDecimal encoding of a  using the ASCII digits. bytestringDecimal encoding of a  using the ASCII digits. bytestringDecimal encoding of a  using the ASCII digits. bytestringCurrently slow. Decimal encoding of an IEEE . bytestringCurrently slow. Decimal encoding of an IEEE . bytestring#Shortest hexadecimal encoding of a  using lower-case characters. bytestring#Shortest hexadecimal encoding of a  using lower-case characters. bytestring#Shortest hexadecimal encoding of a  using lower-case characters. bytestring#Shortest hexadecimal encoding of a  using lower-case characters. bytestring#Shortest hexadecimal encoding of a  using lower-case characters. bytestring Encode a & using 2 nibbles (hexadecimal digits). bytestring Encode a  using 4 nibbles. bytestring Encode a  using 8 nibbles. bytestring Encode a  using 16 nibbles. bytestring Encode a & using 2 nibbles (hexadecimal digits). bytestring Encode a  using 4 nibbles. bytestring Encode a  using 8 nibbles. bytestring Encode a  using 16 nibbles. bytestringEncode an IEEE  using 8 nibbles. bytestringEncode an IEEE  using 16 nibbles. bytestringEncode each byte of a 6$ using its fixed-width hex encoding. bytestringEncode each byte of a lazy $ using its fixed-width hex encoding. bytestring$Maximal power of 10 fitting into an  without using the MSB. 10 ^ 9 for 32 bit ints (31 * log 2 / log 10 = 9.33) 10 ^ 18 for 64 bit ints (63 * log 2 / log 10 = 18.96)2FIXME: Think about also using the MSB. For 64 bit s this makes a difference. bytestringDecimal encoding of an  using the ASCII digits.(c) 2010 Jasper Van der Jeugt (c) 2010 - 2011 Simon MeierBSD3-style (see LICENSE) Simon Meier GHC Trustworthy bytestring Execute a + and return the generated chunks as a lazy . The work is performed lazy, i.e., only when a chunk of the lazy  is forced. bytestring Output a  to a . The + is executed directly on the buffer of the . If the buffer is too small (or not present), then it is replaced with a large enough buffer.It is recommended that the  is set to binary and BlockBuffering mode. See hSetBinaryMode and  hSetBuffering.%This function is more efficient than hPut .  because in many cases no buffer allocation has to be done. Moreover, the results of several executions of short s are concatenated in the 9s buffer, therefore avoiding unnecessary buffer flushes. bytestring"Encode a single signed byte as-is. bytestring$Encode a single unsigned byte as-is. bytestring Encode an  in little endian format. bytestring Encode an  in little endian format. bytestring Encode an  in little endian format. bytestring Encode a  in little endian format. bytestring Encode a  in little endian format. bytestring Encode a  in little endian format. bytestring Encode a  in little endian format. bytestring Encode a  in little endian format. bytestring Encode an  in big endian format. bytestring Encode an  in big endian format. bytestring Encode an  in big endian format. bytestring Encode a  in big endian format. bytestring Encode a  in big endian format. bytestring Encode a  in big endian format. bytestring Encode a  in big endian format. bytestring Encode a  in big endian format. bytestringChar7 encode a . bytestringChar7 encode a . bytestringChar8 encode a . bytestringChar8 encode a . bytestringUTF-8 encode a . bytestringUTF-8 encode a .<< Safe-Inferred> Safe-Inferred< !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ T   ] ^ d e                                                                                                                                                                                                         J K L M ? @ A B R SC8EGI:<>OQDFH9;=NP           bytestring-0.10.9.0Data.ByteString.Builder.Prim%Data.ByteString.Builder.Prim.InternalData.ByteStringData.ByteString.InternalData.ByteString.UnsafeData.ByteString.ShortData.ByteString.Short.InternalData.ByteString.LazyData.ByteString.Lazy.InternalData.ByteString.Builder.Extra Data.ByteString.Builder.InternalData.ByteString.Lazy.Char8Data.ByteString.Char8Data.ByteString.Builder"Data.ByteString.Lazy.Builder.ASCII.Data.ByteString.Builder.Prim.Internal.Floating5Data.ByteString.Builder.Prim.Internal.UncheckedShifts#Data.ByteString.Builder.Prim.BinaryunsafePackCStringLenunsafePackCStringFinalizer System.IOhSetBinaryMode,Data.ByteString.Builder.Prim.Internal.Base16"Data.ByteString.Builder.Prim.ASCIISHShortByteString#Data.ByteString.Lazy.Builder.ExtrasData.ByteString.Builder.ASCIIData.ByteString.Lazy.Builder BoundedPrim FixedPrimSize>$<>*< fixedPrimsizerunFemptyFpairF contramapFtoBliftFixedToBounded storableToF sizeBound boudedPrimrunB contramapBemptyBpairBeitherBcondB$fMonoidalFixedPrim$fContravariantFixedPrim$fMonoidalBoundedPrim$fContravariantBoundedPrimword8word16BEword16LEword32BEword32LEword64BEword64LEwordHost word16Host word32Host word64Hostint8int16BEint16LEint32BEint32LEint64BEint64LEintHost int16Host int32Host int64HostfloatBEfloatLEdoubleBEdoubleLE floatHost doubleHost ByteStringPSc_count c_minimum c_maximum c_intersperse c_reversec_free_finalizerc_strlen packBytes packCharsunsafePackLenBytesunsafePackLenCharsunsafePackAddresspackUptoLenBytespackUptoLenChars unpackBytes unpackCharsunpackAppendBytesLazyunpackAppendCharsLazyunpackAppendBytesStrictunpackAppendCharsStrictnullForeignPtrfromForeignPtr toForeignPtr unsafeCreateunsafeCreateUptoNcreate createUptoN createAndTrimcreateAndTrim'mallocByteString checkedAddw2cc2w isSpaceWord8 isSpaceChar8accursedUnutterablePerformIOinlinePerformIOmemchrmemcmpmemcpymemset$fDataByteString$fIsStringByteString$fReadByteString$fShowByteString$fNFDataByteString$fMonoidByteString$fSemigroupByteString$fOrdByteString$fEqByteStringSBSemptylengthnullindex unsafeIndextoShort fromShortpackunpack copyToPtr createFromPtr packCStringpackCStringLen useAsCStringuseAsCStringLen$fDataShortByteString$fIsStringShortByteString$fReadShortByteString$fShowShortByteString$fNFDataShortByteString$fMonoidShortByteString$fSemigroupShortByteString$fOrdShortByteString$fEqShortByteString unsafeHead unsafeTail unsafeInit unsafeLast unsafeTake unsafeDropunsafePackAddressLenunsafeFinalizeunsafePackCStringunsafePackMallocCStringunsafePackMallocCStringLenunsafeUseAsCStringunsafeUseAsCStringLen singletonconssnocheadtailunconslastinitunsnocappendmapreverse intersperse transposefoldlfoldl'foldrfoldr'foldl1foldl1'foldr1foldr1'concat concatMapanyallmaximumminimum mapAccumL mapAccumRscanlscanl1scanrscanr1 replicateunfoldrunfoldrNtakedropsplitAt takeWhile dropWhilebreak breakBytebreakEndspanspanEnd splitWithsplitgroupgroupBy intercalate elemIndex elemIndexEnd elemIndicescount findIndex findIndiceselemnotElemfilterfind partition isPrefixOf stripPrefix isSuffixOf stripSuffix isInfixOfbreakSubstring findSubstringfindSubstringszipzipWithunzipinitstailssortcopygetLinehGetLinehPuthPutNonBlockinghPutStr hPutStrLnputStrputStrLnhGethGetNonBlockinghGetSome hGetContents getContentsinteractreadFile writeFile appendFileEmptyChunk invariantcheckInvariantchunk foldrChunks foldlChunksdefaultChunkSizesmallChunkSize chunkOverhead fromChunkstoChunks fromStricttoStrictcons'iteraterepeatcyclelinesunlineswordsunwordsreadInt readIntegerchar7int8Decint16Decint32Decint64DecintDecword8Dec word16Dec word32Dec word64DecwordDecword8Hex word16Hex word32Hex word64HexwordHex word8HexFixedword16HexFixedword32HexFixedword64HexFixed int8HexFixed int16HexFixed int32HexFixed int64HexFixed floatHexFixeddoubleHexFixedAllocationStrategyPutBuilder BuildSignal BuildStep ChunkIOStreamFinishedYield1Buffer BufferRange bufferSize newBufferbyteStringFromBufferciosUnitToLazyByteStringciosToLazyByteStringdone bufferFull insertChunkfillWithBuildStepbuilderfinalBuildStep runBuilderrunBuilderWithflushputrunPut putBuilderfromPutputToLazyByteStringputToLazyByteStringWith ensureFreebyteStringThresholdbyteStringCopybyteStringInsertshortByteStringlazyByteStringThresholdlazyByteStringCopylazyByteStringInsert byteStringlazyByteStringmaximalCopySizecustomStrategyuntrimmedStrategy safeStrategytoLazyByteStringWithbuildStepToCIOS$fMonoidBuilder$fSemigroupBuilder $fMonadPut$fApplicativePut $fFunctorPut primFixedprimMapListFixedprimUnfoldrFixedprimMapByteStringFixedprimMapLazyByteStringFixed primBoundedprimMapListBoundedprimUnfoldrBoundedprimMapByteStringBoundedprimMapLazyByteStringBoundedchar8charUtf8NextDoneMore BufferWriterfloatDec doubleDec byteStringHexlazyByteStringHex integerDectoLazyByteString hPutBuilderstring7string8 stringUtf8$fIsStringBuilderbyteStringHexFixedlazyByteStringHexFixedMonoidal Contravariantbase Data.EitherEitherLeftRight Data.MaybemaybeencodeFloatViaWord32Fghc-prim GHC.TypesFloatGHC.WordWord32encodeDoubleViaWord64FDoubleWord64shiftr_wWord shiftr_w16Word16 shiftr_w32 shiftr_w64caseWordSize_32_64GHC.IntInt16Int32Int64IntWord8 createUptoN'eqCharIOGHC.List Data.FoldableGHC.PrimAddr# GHC.MaybeNothingJust GHC.ClassesnotspanByteintercalateWithByteTruezipWith'GHC.IO.Handle.TypesHandleGHC.BaseStringGHC.IO.Handle.TexthGetBuffindIndexOrEndhGetContentsSizeHint hGetContentsNhGetNhGetNonBlockingN breakChar breakSpace dropSpace EncodingTable lowerTableencode8_as_16hInt8GHC.ErrerrorMonoidmemptymappendtrimmedChunkFromBufferyield1 GHC.IO.UnsafeunsafeDupablePerformIOap_l<* Applicativeap_r*>>>MonadwrappedBytesCopyStepshortByteStringCopyStepsanitize Data.OldListencodeCharUtf8maxPow10integer-wired-inGHC.Integer.TypeInteger