*      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                               GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org=Allow a function over a stream to switch between two states.  !"#$%%Specialised, strict Maybe-like type. &'(O(n)& Determines if two streams are equal. )*The empty stream.  !"#$%&'* !!"##$%'&&'* +,-+,-+,-portable experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.org...GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org/=This is a workaround for poor optimisation in GHC 6.8.2. It C fails to notice constant-width shifts, and adds a test and branch < to every shift. This imposes about a 10% performance hit. BThese functions are undefined when the amount being shifted by is / greater than the size in bits of a machine Int#. 01/01/0101GHC experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.org 2byte to check  lower bound  upper bound 3456789:;< 3456789:;< 3456789:;<GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org <An exception type for representing Unicode encoding errors. :Tried to encode a character that could not be represented > under the given encoding, or ran out of input in mid-encode. >Could not decode a byte sequence because it was invalid under 8 the given encoding, or ran out of input in mid-decode. @Function type for handling a coding error. It is supplied with  two inputs:  A = that describes the error. < The input value that caused the error. If the error arose C because the end of input was reached or could not be identified ! precisely, this value will be >. ,If the handler returns a value wrapped with ?, that value will E be used in the output as the replacement for the invalid input. If  it returns >', no value will be used in the output. ;Should the handler need to abort processing, it should use @  or A an exception (preferably a  ). It may @ use the description provided to construct a more helpful error  report. B Throw a  if decoding fails. ;Replace an invalid input byte with the Unicode replacement  character U+FFFD. Throw a  if encoding fails. =Ignore an invalid input, substituting nothing in the output. .Replace an invalid input with a valid output.      GHC experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.orgCDECDECDEGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org7O(n)1 Adds a character to the front of a Stream Char. O(n)* Adds a character to the end of a stream. O(n)" Appends one Stream to the other. O(1)A Returns the first character of a Text, which must be non-empty.  Subject to array fusion. O(1)0 Returns the first character and remainder of a 'Stream  Char', or >% if empty. Subject to array fusion. O(n)! Returns the last character of a ' Stream Char' , which must  be non-empty. O(1)D Returns all characters after the head of a Stream Char, which must  be non-empty. O(1)< Returns all but the last character of a Stream Char, which  must be non-empty. O(1). Tests whether a Stream Char is empty or not. O(n)- Returns the number of characters in a text. O(n)  f +xs is the Stream Char obtained by applying f to each element of  xs. O(n)3 Take a character and place it between each of the  characters of a ' Stream Char'. F O(n); Convert a string to folded case. This function is mainly = useful for performing caseless (or case insensitive) string  comparisons.  A string x" is a caseless match for a string y if and only if:  toCaseFold x == toCaseFold y?The result string may be longer than the input string, and may  differ from applying "% to the input string. For instance, D the Armenian small ligature men now (U+FB13) is case folded to the B bigram men now (U+0574 U+0576), while the micro sign (U+00B5) is E case folded to the Greek small letter letter mu (U+03BC) instead of  itself. !O(n)3 Convert a string to upper case, using simple case E conversion. The result string may be longer than the input string. A For instance, the German eszett (U+00DF) maps to the two-letter  sequence SS. "O(n)3 Convert a string to lower case, using simple case E conversion. The result string may be longer than the input string. B For instance, the Latin capital letter I with dot above (U+0130) @ maps to the sequence Latin small letter i (U+0069) followed by  combining dot above (U+0307). #Efoldl, applied to a binary operator, a starting value (typically the L left-identity of the operator), and a Stream, reduces the Stream using the & binary operator, from left to right. $A strict version of foldl. %Bfoldl1 is a variant of foldl that has no starting value argument, 0 and thus must be applied to non-empty Streams. &A strict version of foldl1. ''@, applied to a binary operator, a starting value (typically the M right-identity of the operator), and a stream, reduces the stream using the & binary operator, from right to left. (foldr1 is a variant of '& that has no starting value argument, 0 and thus must be applied to non-empty streams.  Subject to array fusion. )*O(n)9 Concatenate a list of streams. Subject to array fusion. +JMap a function over a stream that results in a stream and concatenate the  results. ,O(n) any p -xs determines if any character in the stream  xs satisifes the predicate p. -O(n) all p 'xs determines if all characters in the Text  xs satisify the predicate p. .O(n)@ maximum returns the maximum value from a stream, which must be  non-empty. /O(n)* minimum returns the minimum value from a Text, which must be  non-empty. 01O(n) Like a combination of  and # . Applies a ? function to each element of a stream, passing an accumulating ; parameter from left to right, and returns a final stream. Note8: Unlike the version over lists, this function does not A return a final value for the accumulator, because the nature of  streams precludes it. 23O(n), where n3 is the length of the result. The unfoldr function  is analogous to the List 3. unfoldr builds a stream ? from a seed value. The function takes the element and returns < Nothing if it is done producing the stream or returns Just B (a,b), in which case, a is the next Char in the string, and b is ( the seed value for further production. 4O(n) Like 3, 4 builds a stream from a seed < value. However, the length of the result is limited by the  first argument to 4'. This function is more efficient than  3) when the length of the result is known. 5O(n)8 take n, applied to a stream, returns the prefix of the  stream of length n, or the stream itself if n is greater than the  length of the stream. 6O(n)8 drop n, applied to a stream, returns the suffix of the  stream of length n, or the empty stream if n is greater than the  length of the stream. 7"takeWhile, applied to a predicate p and a stream, returns the = longest prefix (possibly empty) of elements that satisfy p. 8 dropWhile p 0xs returns the suffix remaining after takeWhile p xs. 9O(n) The 9 function takes two s and returns  G* iff the first is a prefix of the second. :O(n)* elem is the stream membership predicate. ;O(n) The ;* function takes a predicate and a stream, = and returns the first element in matching the predicate, or >  if there is no such element. <O(n)5 Stream index (subscript) operator, starting from 0. =O(n) =', applied to a predicate and a stream, ? returns a stream containing those characters that satisfy the  predicate. >The >- function takes a predicate and a stream and E returns the index of the first element in the stream satisfying the  predicate. ?The ?- function takes a predicate and a stream and B returns all indices of the elements in the stream satisfying the  predicate. @zipWith generalises zip' by zipping with the function given as 4 the first argument, instead of a tupling function. AO(n) The A) function returns the index of the first 9 element in the given stream which is equal to the query  element, or > if there is no such element. BO(n) The B% function returns the index of every B element in the given stream which is equal to the query element. CO(n) The count0 function returns the number of times the query & element appears in the given stream. HIJ3 !"#$%&'()*+,-./0123456789:;<=>?@ABC3) "!#$%&'(*+,-./0123456789:=;<>?ABC@3 !"#$%&'()*+,-./0123456789:;<=>?@ABCportable experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgK;Operations supported by all elements that can be stored in  arrays. L:Indicate how many bytes would be used for an array of the  given size. M=Unchecked read of an immutable array. May return garbage or # crash on an out-of-bounds access. N:Unchecked read of a mutable array. May return garbage or # crash on an out-of-bounds access. O;Unchecked write of a mutable array. May return garbage or # crash on an out-of-bounds access. P7Read an immutable array. An invalid index results in a  runtime error. Q<Read a mutable array. An invalid index results in a runtime  error. R=Write a mutable array. An invalid index results in a runtime  error. S$Operations supported by all arrays. TReturn the length of an array. U-Mutable array type, for use in the ST monad. VWImmutable array type. XYZ[\]^'Create an uninitialized mutable array. _*Freeze a mutable array. Do not mutate the VU afterwards! `?Create a mutable array, with its elements initialized with the  given value. a&Convert an immutable array to a list. bAn empty immutable array. c?Run an action in the ST monad and return an immutable array of  its result. d?Run an action in the ST monad and return an immutable array of : its result paired with whatever else the action returns. e@Copy an array in its entirety. The destination array must be at  least as big as the source.  source array destination array f(Unsafely copy the elements of an array. KLMNOPQRSTUW^_`abcdefKLMNOPQRLMNOPQRSTTUW^_`abcdefGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgD6A space efficient, packed, unboxed Unicode text type. ghSmart constructor. EO(1) The empty D. i Construct a D- without invisibly pinning its byte array in , memory if its length has dwindled to zero. j A useful k'-like function for debugging purposes. DghEijDgghEijGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orglmnoplmnoplmnopGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgFO(n) Convert a D into a ' Stream Char'. GO(n) Convert a D into a ' Stream Char', but iterate  backwards. HO(n) Convert a ' Stream Char' into a D. IJO(n)% Reverse the characters of a string. KO(n) Perform the equivalent of scanr over a list, only with  the input and result reversed. LO(n) Like unfoldr, L builds a stream from a seed < value. However, the length of the result is limited by the  first argument to L'. This function is more efficient than  unfoldr) when the length of the result is known. MO(n)5 stream index (subscript) operator, starting from 0. NThe N- function takes a predicate and a stream and 6 returns the index of the first element in the stream  satisfying the predicate. OThe O- function takes a predicate and a stream and 3 returns all indices of the elements in the stream  satisfying the predicate. PThe P- function takes a predicate and a stream and 6 returns the index of the first element in the stream  satisfying the predicate. QO(n) The Q) function returns the index of the first 9 element in the given stream which is equal to the query  element, or > if there is no such element. RO(n) The R% function returns the index of every B element in the given stream which is equal to the query element. SO(n) The S0 function returns the number of times the query & element appears in the given stream. FGHIJKLMNOPQRSFHGIJKLMNOPQRSFGHIJKLMNOPQRSportable experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.orgTO(n): Convert a Stream Char into a UTF-8 encoded Stream Word8. UVWXqTUVWXTUVWXportable experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgrO(1) A variant of s for non-empty D. r B omits the check for the empty case, so there is an obligation on , the programmer to provide a proof that the D is non-empty. tO(1) A variant of u for non-empty D. r B omits the check for the empty case, so there is an obligation on , the programmer to provide a proof that the D is non-empty. vO(1)3 Iterate one step forwards through a UTF-16 array, B returning the current character and the delta to add to give the  next offset to iterate at. wO(1)8 Iterate one step through a UTF-16 array, returning the 5 delta to add to give the next offset to iterate at. xO(1)4 Iterate one step backwards through a UTF-16 array, > returning the current character and the delta to add (i.e. a 9 negative number) to give the next offset to iterate at. rtvwxrtvwxportable experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.orgYZO(n) Convert a y into a ' Stream Char', using UTF-8  encoding. [O(n) Convert a y into a ' Stream Char', using little  endian UTF-16 encoding. \O(n) Convert a y into a ' Stream Char' , using big  endian UTF-16 encoding. ]O(n) Convert a y into a ' Stream Char' , using big  endian UTF-32 encoding. ^O(n) Convert a y into a ' Stream Char', using little  endian UTF-32 encoding. _O(n) Convert a  z to a y. { TUVWXYZ[\]^_ YZ[\^]_TVUXWYZ[\]^_portable experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org` Decode a y& containing 7-bit ASCII encoded text. a Decode a y containing UTF-8 encoded text. b Decode a y containing UTF-8 encoded text. c"Encode text using UTF-8 encoding. d0Decode text from little endian UTF-16 encoding. e0Decode text from little endian UTF-16 encoding. f-Decode text from big endian UTF-16 encoding. g-Decode text from big endian UTF-16 encoding. h1Encode text using little endian UTF-16 encoding. i.Encode text using big endian UTF-16 encoding. j0Decode text from little endian UTF-32 encoding. k0Decode text from little endian UTF-32 encoding. l-Decode text from big endian UTF-32 encoding. m-Decode text from big endian UTF-32 encoding. n1Encode text using little endian UTF-32 encoding. o.Encode text using big endian UTF-32 encoding. `abcdefghijklmno`begkmadfjlchino`abcdefghijklmnoportable experimentalTbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org|pO(n) Convert a lazy } into a ' Stream Char', using  UTF-8 encoding. ~O(n) Convert a  z to a lazy }. qO(n) Convert a  z to a lazy }. TUVWXpqpqTVUXWpqGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgrO(n) Create a new D from a   by copying the  contents of the array.  source array length of source array (in  units) sO(1) Return the length of a D in units of . This @ is useful for sizing a target array appropriately before using  t. tO(n) Copy a D. to an array. The array is assumed to be big + enough to hold the contents of the entire D. uO(n)5 Perform an action on a temporary, mutable copy of a  D4. The copy is freed as soon as the action returns. rsturustrstuGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgNvO(n) Convert a = into a D. *This function is subject to array fusion. wO(n) Convert a Text into a String.  Subject to array fusion. xO(1)" Convert a character into a Text.  Subject to array fusion. yO(n)$ Adds a character to the front of a D. This function  is more costly than its List! counterpart because it requires 0 copying a new array. Subject to array fusion. zO(n)" Adds a character to the end of a D. This copies the 8 entire array in the process. Subject to array fusion. {O(n) Appends one D& to the other by copying both of them  into a new D. Subject to array fusion. |O(1)" Returns the first character of a D, which must be & non-empty. Subject to array fusion. }O(1)+ Returns the first character and rest of a D, or  >$ if empty. Subject to array fusion. +Lifted from Control.Arrow and specialized. ~O(1)! Returns the last character of a D, which must be & non-empty. Subject to array fusion. O(1), Returns all characters after the head of a D, which . must be non-empty. Subject to array fusion. O(1)) Returns all but the last character of a D , which must ) be non-empty. Subject to array fusion. O(1) Tests whether a D$ is empty or not. Subject to array  fusion. O(n)' Returns the number of characters in a D.  Subject to array fusion. O(n)  f  xs is the D obtained by applying f to  each element of xs. Subject to array fusion. O(n) The  function takes a D and a list of  D:s and concatenates the list after interspersing the first , argument between each element of the list. O(n) The * function takes a character and places it  between the characters of a D. Subject to array fusion. O(n)> Reverse the characters of a string. Subject to array fusion. O(n); Convert a string to folded case. This function is mainly = useful for performing caseless (or case insensitive) string  comparisons.  A string x" is a caseless match for a string y if and only if:  toCaseFold x == toCaseFold y?The result string may be longer than the input string, and may  differ from applying % to the input string. For instance, D the Armenian small ligature men now (U+FB13) is case folded to the B bigram men now (U+0574 U+0576), while the micro sign (U+00B5) is E case folded to the Greek small letter letter mu (U+03BC) instead of  itself. O(n)3 Convert a string to lower case, using simple case E conversion. The result string may be longer than the input string. B For instance, the Latin capital letter I with dot above (U+0130) @ maps to the sequence Latin small letter i (U+0069) followed by  combining dot above (U+0307). O(n)3 Convert a string to upper case, using simple case E conversion. The result string may be longer than the input string. A For instance, the German eszett (U+00DF) maps to the two-letter  sequence SS. O(n) The * function transposes the rows and columns  of its D) argument. Note that this function uses v,  w:, and the list version of transpose, and is thus not very  efficient. O(n) 1, applied to a binary operator, a starting value 6 (typically the left-identity of the operator), and a D,  reduces the D0 using the binary operator, from left to right.  Subject to array fusion. O(n) A strict version of .  Subject to array fusion. O(n) A variant of & that has no starting value argument, ) and thus must be applied to a non-empty D. Subject to array  fusion. O(n) A strict version of .  Subject to array fusion. O(n) 1, applied to a binary operator, a starting value 7 (typically the right-identity of the operator), and a D,  reduces the D0 using the binary operator, from right to left.  Subject to array fusion. O(n) A variant of * that has no starting value argument, and & thust must be applied to a non-empty D. Subject to array  fusion. O(n) Concatenate a list of Ds. Subject to array fusion. O(n) Map a function over a D that results in a D, and E concatenate the results. This function is subject to array fusion.  Note: if in  f t, f is defined in terms of fusible % functions, it will also be fusible. O(n)  p t) determines whether any character in the  D t satisifes the predicate p. Subject to array fusion. O(n)  p t* determines whether all characters in the  D t satisify the predicate p. Subject to array fusion. O(n) " returns the maximum value from a D, which - must be non-empty. Subject to array fusion. O(n) " returns the minimum value from a D, which - must be non-empty. Subject to array fusion. O(n)  is similar to , but returns a list of C successive reduced values from the left. This function is subject  to array fusion.  B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs. O(n)  is a variant of  that has no starting < value argument. This function is subject to array fusion. 0 scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] O(n)  is the right-to-left dual of . 3 scanr f v == reverse . scanl (flip f) v . reverse O(n)  is a variant of  that has no starting < value argument. This function is subject to array fusion. O(n) Like a combination of  and  . Applies a  function to each element of a D, passing an accumulating 3 parameter from left to right, and returns a final D. The ( function behaves like a combination of  and  -; it applies a function to each element of a D , passing E an accumulating parameter from right to left, and returning a final 1 value of this accumulator together with the new D. O(n)  n c is a D of length n with c the , value of every element. Subject to fusion. O(n), where n" is the length of the result. The  # function is analogous to the List .  builds a  D7 from a seed value. The function takes the element and  returns > if it is done producing the D , otherwise  ? (a,b). In this case, a is the next  in the  string, and b3 is the seed value for further production. Subject  to fusion. O(n) Like ,  builds a D from a seed C value. However, the length of the result should be limited by the  first argument to '. This function is more efficient than  4 when the maximum length of the result is known and 2 correct, otherwise its performance is similar to  . Subject  to fusion. O(n)  n, applied to a D, returns the prefix of the  D of length n , or the D itself if n is greater than , the length of the Text. Subject to fusion. O(n)  n, applied to a D, returns the suffix of the  D of length n, or the empty D if n is greater than the  length of the D. Subject to fusion. O(n) , applied to a predicate p and a D , returns > the longest prefix (possibly empty) of elements that satisfy p. + This function is subject to array fusion. O(n)  p xs$ returns the suffix remaining after   p xs,. This function is subject to array fusion. O(n)  n t) returns a pair whose first element is a  prefix of t of length n', and whose second is the remainder of ! the string. It is equivalent to ( n t,  n t). O(n) , applied to a predicate p and text t , returns a D pair whose first element is the longest prefix (possibly empty) of  t of elements that satisfy p$, and whose second is the remainder  of the list. O(n)  is like ", but the prefix returned is over " elements that fail the predicate p. O(n)8 Group characters in a string according to a predicate.  Returns the array index (in units of  ) at which a " character may be found. This is not the same as the logical  index returned by e.g. . O(n)+ Group characters in a string by equality. O(n)* Return all initial segments of the given D , shortest  first. O(n)( Return all final segments of the given D , longest  first. O(n) Break a D into pieces separated by the  ) argument, consuming the delimiter. I.e.  . split '\n' "a\nb\nd\ne" == ["a","b","d","e"] 0 split 'a' "aXaXaXa" == ["","X","X","X",""] $ split 'x' "x" == ["",""] and  + intercalate (singleton c) . split c == id  split == splitWith . (==) CAs for all splitting functions in this library, this function does 1 not copy the substrings, it just constructs new D s that are  slices of the original. O(n) Splits a D* into components delimited by separators, @ where the predicate returns True for a separator element. The C resulting components do not contain the separators. Two adjacent = separators result in an empty component in the output. eg. 4 splitWith (=='a') "aabbaca" == ["","","bb","c",""] # splitWith (=='a') [] == [] O(n)  is the D membership predicate. O(n) The " function takes a predicate and a D, = and returns the first element in matching the predicate, or >  if there is no such element. O(n) The " function takes a predicate and a D,  and returns the pair of D$s with elements which do and do not + satisfy the predicate, respectively; i.e. 3 partition p t == (filter p t, filter (not . p) t) O(n)8 Break a string on a substring, returning a pair of the D part of the string prior to the match, and the rest of the string. "The following relationship holds:  1 break (==c) l == breakSubstring (singleton c) l 8For example, to tokenise a string, dropping delimiters:  J tokenise x y = h : if null t then [] else tokenise x (drop (length x) t) & where (h,t) = breakSubstring x y ,To skip to the first occurence of a string:   snd (breakSubstring x y) 2To take the parts of a string before a delimiter:  fst (breakSubstring x y) String to search for String to search in ,Head and tail of string broken at substring O(n) , applied to a predicate and a D,  returns a D. containing those characters that satisfy the  predicate. O(n) D. index (subscript) operator, starting from 0. O(n) The " function takes a predicate and a D 3 and returns the index of the first element in the D satisfying 4 the predicate. This function is subject to fusion. The  function extends , by returning the @ indices of all elements satisfying the predicate, in ascending , order. This function is subject to fusion. O(n) The ) function returns the index of the first  element in the given D) which is equal to the query element, or  >: if there is no such element. This function is subject to  fusion. O(n) The % function returns the index of every  element in the given D which is equal to the query . element. This function is subject to fusion. O(n) The 0 function returns the number of times the query  element appears in the given D. This function is subject to  fusion. O(n)  takes two Ds and returns a list of , corresponding pairs of bytes. If one input D is short,  excess elements of the longer D are discarded. This is  equivalent to a pair of w operations. O(n)  generalises  by zipping with the function = given as the first argument, instead of a tupling function. O(n) Breaks a D' up into a list of words, delimited by s  representing white space. O(n) Breaks a D up into a list of Ds at  newline 2s. The resulting strings do not contain newlines. O(n) Portably breaks a D up into a list of D s at line  boundaries. CA line boundary is considered to be either a line feed, a carriage C return immediately followed by a line feed, or a carriage return. B This accounts for both Unix and Windows line ending conventions, : and for the old convention used on Mac OS 9 and earlier. O(n)7 Joins lines, after appending a terminating newline to  each. O(n), Joins words using single space characters. O(n) The  function takes two Ds and returns  G< iff the first is a prefix of the second. This function is  subject to fusion. O(n) The  function takes two Ds and returns  G* iff the first is a suffix of the second. O(n) The  function takes two Ds and returns  G9 iff the first is contained, wholly and intact, anywhere  within the second. MDEvwxyz{|}~MDvwxEyz{}|~Kvwxyz{|}~GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org The data type invariant: Every  is either  or  consists of non-null D&s. All functions must preserve this, ( and the QC properties must check this. ,In a form that checks the invariant lazily. Smart constructor for &. Guarantees the data type invariant. Smart constructor for . Consume the chunks of a lazy  with a natural right fold. Consume the chunks of a lazy  with a strict, tail-recursive,  accumulating left fold. ;Currently set to 32k, less the memory management overhead. :Currently set to 4k, less the memory management overhead. FThe memory management overhead. Currently this is tuned for GHC only.   GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org O(n) Convert a  into a ' Stream Char'. O(n) Convert a ' Stream Char' into a , using the given  chunk size. O(n) Convert a ' Stream Char' into a , using  . O(n)- Returns the number of characters in a text. O(n) Like unfoldr,  unfoldrN64 builds a stream from a seed < value. However, the length of the result is limited by the  first argument to  unfoldrN64'. This function is more efficient than  unfoldr) when the length of the result is known. O(n)5 stream index (subscript) operator, starting from 0. The - function takes a predicate and a stream and 6 returns the index of the first element in the stream  satisfying the predicate. The - function takes a predicate and a stream and 3 returns all indices of the elements in the stream  satisfying the predicate. O(n) The ) function returns the index of the first 9 element in the given stream which is equal to the query  element, or > if there is no such element. O(n) The % function returns the index of every B element in the given stream which is equal to the query element. O(n) The 0 function returns the number of times the query & element appears in the given stream. GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgOO(n) Convert a = into a . *This function is subject to array fusion. O(n) Convert a  into a =.  Subject to array fusion. O(c) Convert a list of strict Ds into a lazy . O(n) Convert a lazy  into a list of strict Ds. O(n\c)/ Appends one  to another. Subject to array  fusion. O(1)+ Returns the first character and rest of a , or  >$ if empty. Subject to array fusion. O(1)" Returns the first character of a , which must be & non-empty. Subject to array fusion. O(1), Returns all characters after the head of a , which . must be non-empty. Subject to array fusion. O(1)) Returns all but the last character of a  , which must ) be non-empty. Subject to array fusion. O(1) Tests whether a $ is empty or not. Subject to array  fusion. O(1)! Returns the last character of a , which must be & non-empty. Subject to array fusion. O(n)  f  xs is the  obtained by applying f to  each element of xs. Subject to array fusion. O(n) The  function takes a  and a list of  :s and concatenates the list after interspersing the first , argument between each element of the list. O(n) The * function takes a character and places it  between the characters of a . Subject to array fusion. O(n) The * function transposes the rows and columns  of its ) argument. Note that this function uses ,  :, and the list version of transpose, and is thus not very  efficient. O(n)  t returns the elements of t in reverse order. O(n); Convert a string to folded case. This function is mainly = useful for performing caseless (or case insensitive) string  comparisons.  A string x" is a caseless match for a string y if and only if:  toCaseFold x == toCaseFold y?The result string may be longer than the input string, and may  differ from applying % to the input string. For instance, D the Armenian small ligature men now (U+FB13) is case folded to the B bigram men now (U+0574 U+0576), while the micro sign (U+00B5) is E case folded to the Greek small letter letter mu (U+03BC) instead of  itself. O(n)3 Convert a string to lower case, using simple case E conversion. The result string may be longer than the input string. B For instance, the Latin capital letter I with dot above (U+0130) @ maps to the sequence Latin small letter i (U+0069) followed by  combining dot above (U+0307). O(n)3 Convert a string to upper case, using simple case E conversion. The result string may be longer than the input string. A For instance, the German eszett (U+00DF) maps to the two-letter  sequence SS. O(n) 1, applied to a binary operator, a starting value 6 (typically the left-identity of the operator), and a ,  reduces the 0 using the binary operator, from left to right.  Subject to array fusion. O(n) A strict version of .  Subject to array fusion. O(n) A variant of & that has no starting value argument, ) and thus must be applied to a non-empty . Subject to array  fusion. O(n) A strict version of .  Subject to array fusion. O(n) 1, applied to a binary operator, a starting value 7 (typically the right-identity of the operator), and a ,  reduces the 0 using the binary operator, from right to left.  Subject to array fusion. O(n) A variant of * that has no starting value argument, and & thust must be applied to a non-empty . Subject to array  fusion. O(n) Concatenate a list of s. Subject to array fusion. O(n) Map a function over a  that results in a , and E concatenate the results. This function is subject to array fusion.  Note: if in  f t, f is defined in terms of fusible % functions, it will also be fusible. O(n)  p t) determines whether any character in the   t satisifes the predicate p. Subject to array fusion. O(n)  p t* determines whether all characters in the   t satisify the predicate p. Subject to array fusion. O(n) " returns the maximum value from a , which - must be non-empty. Subject to array fusion. O(n) " returns the minimum value from a , which - must be non-empty. Subject to array fusion. O(n)  is similar to , but returns a list of C successive reduced values from the left. This function is subject  to array fusion.  B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs. O(n)  is a variant of  that has no starting < value argument. This function is subject to array fusion. 0 scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] O(n)  is the right-to-left dual of . 3 scanr f v == reverse . scanl (flip f) v . reverse O(n)  is a variant of  that has no starting  value argument. O(n) Like a combination of  and  . Applies a  function to each element of a , passing an accumulating 3 parameter from left to right, and returns a final . The ( function behaves like a combination of  and  -; it applies a function to each element of a  , passing E an accumulating parameter from right to left, and returning a final 1 value of this accumulator together with the new . O(n)  n c is a  of length n with c the  value of every element. O(n), where n" is the length of the result. The  # function is analogous to the List .  builds a  7 from a seed value. The function takes the element and  returns > if it is done producing the  , otherwise  ? (a,b). In this case, a is the next  in the  string, and b+ is the seed value for further production. O(n) Like ,  builds a  from a seed C value. However, the length of the result should be limited by the  first argument to '. This function is more efficient than  4 when the maximum length of the result is known and 2 correct, otherwise its performance is similar to . O(n)  n, applied to a , returns the prefix of the   of length n , or the  itself if n is greater than , the length of the Text. Subject to fusion. O(n)  n, applied to a , returns the suffix of the   of length n, or the empty  if n is greater than the  length of the . Subject to fusion. O(n) , applied to a predicate p and a  , returns > the longest prefix (possibly empty) of elements that satisfy p. + This function is subject to array fusion. O(n)  p xs$ returns the suffix remaining after   p xs,. This function is subject to array fusion. O(n)  n t) returns a pair whose first element is a  prefix of t of length n', and whose second is the remainder of ! the string. It is equivalent to ( n t,  n t). O(n)  is like ", but the prefix returned is over " elements that fail the predicate p. O(n) , applied to a predicate p and text t , returns a D pair whose first element is the longest prefix (possibly empty) of  t of elements that satisfy p$, and whose second is the remainder  of the list. The  function takes a  and returns a list of s E such that the concatenation of the result is equal to the argument. D Moreover, each sublist in the result contains only equal elements.  For example,  < group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"] It is a special case of !, which allows the programmer to ! supply their own equality test. The + function is the non-overloaded version of . O(n)* Return all initial segments of the given ,  shortest first. O(n)( Return all final segments of the given  , longest  first. O(n) Break a # into pieces separated by the byte ) argument, consuming the delimiter. I.e.  . split '\n' "a\nb\nd\ne" == ["a","b","d","e"] 0 split 'a' "aXaXaXa" == ["","X","X","X",""] $ split 'x' "x" == ["",""] and  ! intercalate [c] . split c == id  split == splitWith . (==) CAs for all splitting functions in this library, this function does 1 not copy the substrings, it just constructs new  s that are  slices of the original. O(n) Splits a * into components delimited by separators, @ where the predicate returns True for a separator element. The C resulting components do not contain the separators. Two adjacent = separators result in an empty component in the output. eg. 4 splitWith (=='a') "aabbaca" == ["","","bb","c",""] # splitWith (=='a') [] == [] O(n) Breaks a  up into a list of s at  newline 2s. The resulting strings do not contain newlines. O(n) Breaks a ' up into a list of words, delimited by s  representing white space.  O(n)7 Joins lines, after appending a terminating newline to  each.  O(n), Joins words using single space characters.  O(n) The   function takes two s and returns  G< iff the first is a prefix of the second. This function is  subject to fusion.  O(n) The   function takes two s and returns  G* iff the first is a suffix of the second.  O(n) The   function takes two s and returns  G9 iff the first is contained, wholly and intact, anywhere  within the second. O(n)  is the  membership predicate. O(n) , applied to a predicate and a ,  returns a . containing those characters that satisfy the  predicate. O(n) The " function takes a predicate and a , = and returns the first element in matching the predicate, or >  if there is no such element. O(n) The " function takes a predicate and a ,  and returns the pair of $s with elements which do and do not + satisfy the predicate, respectively; i.e. 3 partition p t == (filter p t, filter (not . p) t) O(n) . index (subscript) operator, starting from 0. O(n) The " function takes a predicate and a  3 and returns the index of the first element in the  satisfying 4 the predicate. This function is subject to fusion. The  function extends , by returning the @ indices of all elements satisfying the predicate, in ascending , order. This function is subject to fusion. O(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 function is subject to  fusion. O(n) The % function returns the index of every  element in the given  which is equal to the query . element. This function is subject to fusion. O(n) The 0 function returns the number of times the query  element appears in the given . This function is subject to  fusion. O(n)  takes two s and returns a list of , corresponding pairs of bytes. If one input  is short,  excess elements of the longer  are discarded. This is  equivalent to a pair of  operations. O(n)  generalises  by zipping with the function = given as the first argument, instead of a tupling function. N     N     L      portable experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org Decode a } containing UTF-8 encoded text.  Decode a } containing UTF-8 encoded text. "Encode text using UTF-8 encoding.        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu_vwxyz{|}~q_(+,-./0123`5@6a798:;<=>?ABCDEFGHIJcLMNOQRTdefhijWP[\ ] _ ` c d e f h i j ( + , - / . 1 2 3 0 ` 5 @ 6 a 7 9 8 : ; < = > ? A B C D E F G H I J c L M N O P Q T R d e f h i j W w x y            \ d`\[.1J       text-0.3Data.Text.FusionData.Text.Encoding.ErrorData.Text.Fusion.Common Data.TextData.Text.Encoding.FusionData.Text.EncodingData.Text.Lazy.Encoding.FusionData.Text.ForeignData.Text.LazyData.Text.Lazy.FusionData.Text.Lazy.EncodingData.Text.Fusion.InternalData.Text.Fusion.CaseMappingData.Text.Encoding.Utf32Data.Text.UnsafeShiftData.Text.Encoding.Utf8Data.Text.Encoding.Utf16Data.Text.ArrayData.Text.InternalData.Text.UnsafeChar Data.Text.Encoding.Fusion.CommonData.Text.UnsafeData.Text.Lazy.InternalStreamStepYieldSkipDoneUnicodeException EncodeError DecodeError OnEncodeError OnDecodeErrorOnError strictDecode lenientDecode strictEncodeignorereplace singleton streamList unstreamListconssnocappendheadunconslasttailinitnulllengthImap intersperse toCaseFoldtoUppertoLowerfoldlfoldl'foldl1foldl1'foldrfoldr1 intercalateconcat concatMapanyallmaximumminimumscanl mapAccumL replicateunfoldr unfoldrNItakedrop takeWhile dropWhile isPrefixOfelemfindindexIfilter findIndexI findIndicesIzipWith elemIndexI elemIndicesIcountITextemptystream reverseStreamunstreamlengthreverse reverseScanrunfoldrNindex findIndex findIndicesfindIndexOrEnd elemIndex elemIndicescount restreamUtf8restreamUtf16BErestreamUtf16LErestreamUtf32BErestreamUtf32LE streamASCII streamUtf8 streamUtf16LE streamUtf16BE streamUtf32BE streamUtf32LE decodeASCIIdecodeUtf8With decodeUtf8 encodeUtf8decodeUtf16LEWith decodeUtf16LEdecodeUtf16BEWith decodeUtf16BE encodeUtf16LE encodeUtf16BEdecodeUtf32LEWith decodeUtf32LEdecodeUtf32BEWith decodeUtf32BE encodeUtf32LE encodeUtf32BEfromPtr lengthWord16unsafeCopyToPtruseAsPtrpackunpack transposescanl1scanrscanr1 mapAccumRsplitAtspanbreakgroupBygroupinitstailssplit splitWith partitionbreakSubstringzipwordslinesunlinesunwords isSuffixOf isInfixOfunstreamChunks fromChunkstoChunksSwitchS2S1PairS:!:SM8MJNeqcmp upperMapping lowerMapping foldMappingvalidate UnsafeShiftshiftLshiftRbetweenord2ord3ord4chr2chr3chr4 validate1 validate2 validate3 validate4baseGHC.BaseString Data.MaybeNothingJustGHC.Errerror GHC.ExceptionthrowshowUnicodeException caseConvertghc-primGHC.BoolTrue streamError emptyError internalErrorElt bytesInArray unsafeIndex unsafeRead unsafeWritereadwriteIArrayMArrayArrayarrayTcmArrayTccheck iNT_SCALE wORD16_SCALE unsafeNew unsafeFreezenewtoListrunrun2copy unsafeCopytexttextPshowTextGHC.Showshow unsafeChr unsafeChr8 unsafeChr32unsafeWriteRev unsafeHeadGHC.List unsafeTailiteriter_ reverseIterbytestring-0.9.1.7Data.ByteString.Internal ByteStringGHC.WordWord8 decodeError unknownLengthData.ByteString.Lazy.InternalGHC.PtrPtrWord16second Data.List GHC.TypesCharfindAIndexOrEndChunkEmpty invariant showStructurecheckInvariantchunk foldrChunks foldlChunksdefaultChunkSizesmallChunkSize chunkOverhead revChunksimpossibleError