G\      !"#$%&'()*+,-./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#.  GHC experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.org byte to check  lower bound  upper bound  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  an exception (preferably a  ). It may @ use the description provided to construct a more helpful error  report. 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.org GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org8O(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'. 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. &'()O(n), where n3 is the length of the result. The unfoldr function  is analogous to the List ). 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. *O(n) Like ), * builds a stream from a seed < value. However, the length of the result is limited by the  first argument to *'. This function is more efficient than  )) when the length of the result is known. +O(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. ,O(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. -"takeWhile, applied to a predicate p and a stream, returns the = longest prefix (possibly empty) of elements that satisfy p. . dropWhile p 0xs returns the suffix remaining after takeWhile p xs. /O(n) The / function takes two s and returns  0* iff the first is a prefix of the second. 1O(n)* elem is the stream membership predicate. 2O(n) The 2* function takes a predicate and a stream, = and returns the first element in matching the predicate, or   if there is no such element. 3O(n)5 Stream index (subscript) operator, starting from 0. 4O(n) 4', applied to a predicate and a stream, ? returns a stream containing those characters that satisfy the  predicate. 5The 5- function takes a predicate and a stream and E returns the index of the first element in the stream satisfying the  predicate. 6The 6- function takes a predicate and a stream and B returns all indices of the elements in the stream satisfying the  predicate. 7zipWith generalises zip' by zipping with the function given as 4 the first argument, instead of a tupling function. 8O(n) The 8) 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. 9O(n) The 9% function returns the index of every B element in the given stream which is equal to the query element. :O(n) The :* function returns the number of times the , query element appears in the given stream. ;<=4      !"#$%&'()*+,-./123456789:4      !"#$%&'()*+,-./123456789:portable experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org>;Operations supported by all elements that can be stored in  arrays. ?:Indicate how many bytes would be used for an array of the  given size. @=Unchecked read of an immutable array. May return garbage or # crash on an out-of-bounds access. A:Unchecked read of a mutable array. May return garbage or # crash on an out-of-bounds access. B;Unchecked write of a mutable array. May return garbage or # crash on an out-of-bounds access. C7Read an immutable array. An invalid index results in a  runtime error. D<Read a mutable array. An invalid index results in a runtime  error. E=Write a mutable array. An invalid index results in a runtime  error. F$Operations supported by all arrays. GReturn the length of an array. H-Mutable array type, for use in the ST monad. IJImmutable array type. KLMNOP'Create an uninitialized mutable array. Q*Freeze a mutable array. Do not mutate the IH afterwards! R?Create a mutable array, with its elements initialized with the  given value. S&Convert an immutable array to a list. TAn empty immutable array. U?Run an action in the ST monad and return an immutable array of  its result. V?Run an action in the ST monad and return an immutable array of : its result paired with whatever else the action returns. W@Copy an array in its entirety. The destination array must be at  least as big as the source.  source array destination array X(Unsafely copy the elements of an array. >?@ABCDEFGHJPQRSTUVWX>?@ABCDE?@ABCDEFGGHJPQRSTUVWXGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org 6A space efficient, packed, unboxed Unicode text type. YZSmart constructor. O(1) The empty  . [ Construct a  - without invisibly pinning its byte array in , memory if its length has dwindled to zero. \ A useful ]'-like function for debugging purposes.  YZ [\ YYZ [\GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org^_`a^_`a^_`aGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgbO(n) Convert a   into a ' Stream Char'. cO(n) Convert a   into a ' Stream Char', but iterate  backwards. dO(n) Convert a ' Stream Char' into a  . efO(n)% Reverse the characters of a string. gO(n) Perform the equivalent of scanr over a list, only with  the input and result reversed. hO(n) Like unfoldr, h builds a stream from a seed < value. However, the length of the result is limited by the  first argument to h'. This function is more efficient than  unfoldr) when the length of the result is known. iO(n)5 stream index (subscript) operator, starting from 0. jThe j- function takes a predicate and a stream and 6 returns the index of the first element in the stream  satisfying the predicate. kThe k- function takes a predicate and a stream and 3 returns all indices of the elements in the stream  satisfying the predicate. lThe l- function takes a predicate and a stream and 6 returns the index of the first element in the stream  satisfying the predicate. mO(n) The m) 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. nO(n) The n% function returns the index of every B element in the given stream which is equal to the query element. oO(n) The count0 function returns the number of times the query & element appears in the given stream. bcdefghijklmnobcdefghijklmnoportable experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.orgpO(n): Convert a Stream Char into a UTF-8 encoded Stream Word8. qrstupqrstpqrstportable experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgvO(1) A variant of w for non-empty  . v B omits the check for the empty case, so there is an obligation on , the programmer to provide a proof that the   is non-empty. xO(1) A variant of y for non-empty  . v B omits the check for the empty case, so there is an obligation on , the programmer to provide a proof that the   is non-empty. zO(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. {O(1)8 Iterate one step through a UTF-16 array, returning the 5 delta to add to give the next offset to iterate at. |O(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. vxz{|vxz{|portable experimentalSrtharper@aftereternity.co.uk, bos@serpentine.com, duncan@haskell.org}~O(n) Convert a  into a ' Stream Char', using UTF-8  encoding. O(n) Convert a  into a ' Stream Char', using little  endian UTF-16 encoding. O(n) Convert a  into a ' Stream Char' , using big  endian UTF-16 encoding. O(n) Convert a  into a ' Stream Char' , using big  endian UTF-32 encoding. O(n) Convert a  into a ' Stream Char', using little  endian UTF-32 encoding. O(n) Convert a   to a .  pqrst}~}~portable experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org  Decode a & containing 7-bit ASCII encoded text.  Decode a  containing UTF-8 encoded text.  Decode a  containing UTF-8 encoded text. "Encode text using UTF-8 encoding. 0Decode text from little endian UTF-16 encoding. 0Decode text from little endian UTF-16 encoding. -Decode text from big endian UTF-16 encoding. -Decode text from big endian UTF-16 encoding. 1Encode text using little endian UTF-16 encoding. .Encode text using big endian UTF-16 encoding. 0Decode text from little endian UTF-32 encoding. 0Decode text from little endian UTF-32 encoding. -Decode text from big endian UTF-32 encoding. -Decode text from big endian UTF-32 encoding. 1Encode text using little endian UTF-32 encoding. .Encode text using big endian UTF-32 encoding.    portable experimentalTbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgO(n) Convert a lazy  into a ' Stream Char', using  UTF-8 encoding. O(n) Convert a   to a lazy . O(n) Convert a   to a lazy . pqrstGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.orgO(n) Create a new   from a   by copying the  contents of the array.  source array length of source array (in  units) O(1) Return the length of a   in units of . This @ is useful for sizing a target array appropriately before using  . O(n) Copy a  . to an array. The array is assumed to be big + enough to hold the contents of the entire  . O(n)5 Perform an action on a temporary, mutable copy of a   4. The copy is freed as soon as the action returns.    GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org[!O(n) Convert a  into a  . Subject to fusion. "O(n)3 Convert a Text into a String. Subject to fusion. #O(1)" Convert a character into a Text.  Subject to fusion. $O(n)$ Adds a character to the front of a  . This function  is more costly than its List! counterpart because it requires * copying a new array. Subject to fusion. %O(n)" Adds a character to the end of a  . This copies the @ entire array in the process, unless fused. Subject to fusion. &O(n) Appends one  & to the other by copying both of them  into a new  . Subject to fusion. 'O(1)" Returns the first character of a  , which must be  non-empty. Subject to fusion. (O(1)+ Returns the first character and rest of a  , or   if empty. Subject to fusion. +Lifted from Control.Arrow and specialized. )O(1)! Returns the last character of a  , which must be  non-empty. Subject to fusion. *O(1), Returns all characters after the head of a  , which ( must be non-empty. Subject to fusion. +O(1)) Returns all but the last character of a   , which must # be non-empty. Subject to fusion. ,O(1) Tests whether a   is empty or not. Subject to  fusion. -O(n)' Returns the number of characters in a  .  Subject to fusion. .O(n) . f t is the   obtained by applying f to  each element of t. Subject to 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. 0O(n) The 0* function takes a character and places it  between the characters of a  . Subject to fusion. 1O(n)8 Reverse the characters of a string. Subject to fusion. 2 O(m)*O(n)9 Replace every occurrence of one substring with another. Text to search for Replacement text  Input text 3O(n); Convert a string to folded case. This function is mainly A useful for performing caseless (also known as 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 4% to the input string. For instance,  the Armenian small ligature "" (men now, U+FB13) is case  folded to the sequence "t" (men, U+0574) followed by  "v" (now, U+0576), while the Greek "" (micro sign,  U+00B5) is case folded to "" (small letter mu, U+03BC)  instead of itself. 4O(n)3 Convert a string to lower case, using simple case E conversion. The result string may be longer than the input string.  For instance, "0") (Latin capital letter I with dot above,  U+0130) maps to the sequence "i") (Latin small letter i, U+0069) followed  by " " (combining dot above, U+0307). 5O(n)3 Convert a string to upper case, using simple case E conversion. The result string may be longer than the input string.  For instance, the German "" (eszett, U+00DF) maps to the  two-letter sequence "SS". 6O(n)6 Left-justify a string to the given length, using the E specified fill character on the right. Subject to fusion. Examples: ) justifyLeft 7 'x' "foo" == "fooxxxx" ( justifyLeft 3 'x' "foobar" == "foobar" 7O(n)7 Right-justify a string to the given length, using the 1 specified fill character on the left. Examples: * justifyRight 7 'x' "bar" == "xxxxbar" ) justifyRight 3 'x' "foobar" == "foobar" 8O(n)0 Center a string to the given length, using the 4 specified fill character on either side. Examples:  center 8 'x' "HS" = "xxxHSxxx" 9O(n) The 9* 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) :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 fusion. ;O(n) A strict version of :. Subject to fusion. <O(n) A variant of :& that has no starting value argument, ) and thus must be applied to a non-empty  . Subject to fusion. =O(n) A strict version of <. Subject to 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 fusion. ?O(n) A variant of >& that has no starting value argument, * and thust must be applied to a non-empty  . Subject to  fusion. @O(n) Concatenate a list of  s. Subject to fusion. AO(n) Map a function over a   that results in a  , and . concatenate the results. Subject to fusion.  Note: if in A f t, f is defined in terms of fusible % functions, it will also be fusible. BO(n) B p t) determines whether any character in the    t satisifes the predicate p. Subject to fusion. CO(n) C p t* determines whether all characters in the    t satisify the predicate p. Subject to fusion. DO(n) D" returns the maximum value from a  , which ' must be non-empty. Subject to fusion. EO(n) E" returns the minimum value from a  , which ' must be non-empty. Subject to fusion. FO(n) F is similar to :, but returns a list of = successive reduced values from the left. Subject to 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. GO(n) G is a variant of F that has no starting % value argument. Subject to fusion. 0 scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] HO(n) H is the right-to-left dual of F. 3 scanr f v == reverse . scanl (flip f) v . reverse IO(n) I is a variant of H that has no starting % value argument. Subject to fusion. JO(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  . KThe K( 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  . LO(n*m) L n t is a   consisting of the input  t repeated n times. Subject to fusion. MO(n) M n c is a   of length n with c the , value of every element. Subject to fusion. NO(n), where n" is the length of the result. The N # function is analogous to the List . N 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 b3 is the seed value for further production. Subject  to fusion. OO(n) Like N, O builds a   from a seed C value. However, the length of the result should be limited by the  first argument to O'. This function is more efficient than  N4 when the maximum length of the result is known and 2 correct, otherwise its performance is similar to N . Subject  to fusion. PO(n) P 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. QO(n) Q 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. RO(n) R, applied to a predicate p and a  , > returns the longest prefix (possibly empty) of elements that  satisfy p. Subject to fusion. SO(n) S p t$ returns the suffix remaining after  R p t. Subject to fusion. TO(n) T p t$ returns the prefix remaining after - dropping characters that fail the predicate p from the end of  t. Subject to fusion.  Examples: ( dropWhileEnd (=='.') "foo..." == "foo" UO(n) U p t' returns the substring remaining after - dropping characters that fail the predicate p from both the  beginning and end of t. Subject to fusion. VO(n); Remove leading white space from a string. Equivalent to:  dropWhile isSpace WO(n)< Remove trailing white space from a string. Equivalent to:  dropWhileEnd isSpace XO(n)8 Remove leading and trailing white space from a string.  Equivalent to:  dropAround isSpace YO(n) Y 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 (P n t, Q n t). ZO(n) Z, 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 Z", 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. j. ]O(n)+ Group characters in a string by equality. ^O(n)* Return all initial segments of the given   , shortest  first. _O(n)( Return all final segments of the given   , longest  first. ` O(m)*O(n) Break a  $ into pieces separated by the first   : argument, consuming the delimiter. An empty delimiter is 0 invalid, and will cause an error to be raised.  Examples:  6 split "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"] 8 split "aaa" "aaaXaaaXaaaXaaa" == ["","X","X","X",""] , split "x" "x" == ["",""] and ' intercalate s . split s == id 4 split (singleton c) == splitWith (==c) Text to split on  Input text a O(m)*O(n) Break a   into pieces at most k times,  treating the first  ( argument as the delimiter to break on, E and consuming the delimiter. The last element of the list contains @ the remaining text after the number of times to split has been ' reached. A value of zero or less for k causes no splitting to E occur. An empty delimiter is invalid, and will cause an error to be  raised.  Examples:  1 splitTimes 0 "//" "a//b//c" == ["a//b//c"] 7 splitTimes 2 ":" "a:b:c:d:e" == ["a","b","c:d:e"] 0 splitTimes 100 "???" "a????b" == ["a","?b"] and ( intercalate s . splitTimes k s == id !Maximum number of times to split Text to split on  Input text b O(m)*O(n) Break a   into pieces at most k times, like  a7, but start from the end of the input and work towards  the start.  Examples: = splitTimes 2 "::" "a::b::c::d::e" == ["a","b","c::d::e"] = splitTimesEnd 2 "::" "a::b::c::d::e" == ["a::b::c","d","e"] !Maximum number of times to split Text to split on  Input text cO(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') "" == [""] dO(n) Splits a   into components of length k . The last @ element may be shorter than the other chunks, depending on the  length of the input. Examples: 1 chunksOf 3 "foobarbaz" == ["foo","bar","baz"] 3 chunksOf 4 "haskell.org" == ["hask","ell.","org"] eO(n) e is the   membership predicate. fO(n) The f" function takes a predicate and a  , = and returns the first element in matching the predicate, or   if there is no such element. gO(n) The g" 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) hO(n) h, applied to a predicate and a  ,  returns a  . containing those characters that satisfy the  predicate. iO(n)  . index (subscript) operator, starting from 0. jO(n) The j" function takes a predicate and a   3 and returns the index of the first element in the   satisfying # the predicate. Subject to fusion. kThe k function extends j, by returning the @ indices of all elements satisfying the predicate, in ascending  order. Subject to fusion. lO(n) The l) function returns the index of the first  element in the given  ) which is equal to the query element, or  1 if there is no such element. Subject to fusion. mO(n) The m% function returns the index of every  element in the given   which is equal to the query  element. Subject to fusion. nO(n*m) The n* function returns the number of times the # query string appears in the given  . An empty query string is 0 invalid, and will cause an error to be raised. O(n) The * function returns the number of times the $ query element appears in the given  . Subject to fusion. oO(n) o 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. pO(n) p generalises o by zipping with the function = given as the first argument, instead of a tupling function. qO(n) Breaks a  ' up into a list of words, delimited by s  representing white space. rO(n) Breaks a   up into a list of  s at  newline 2s. The resulting strings do not contain newlines. sO(n) Portably breaks a   up into a list of   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. tO(n), Joins words using single space characters. uO(n) The u function takes two  s and returns  0< iff the first is a prefix of the second. This function is  subject to fusion. vO(n) The v function takes two  s and returns  0* iff the first is a suffix of the second. wO(n) The w function takes two  s and returns  09 iff the first is contained, wholly and intact, anywhere  within the second. Y !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwY !"# $%&(')*+,-./0912345678:;<=>?@ABCDEFGHIJKLMNOPQRSTUXVWYZ[]\^_`abcdrqstuvwehfgijklmnopW!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org xThe data type invariant: Every x is either  or  consists of non-null  &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. ySmart constructor for . Consume the chunks of a lazy x with a natural right fold. Consume the chunks of a lazy x 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. xy xyGHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org O(n) Convert a x into a ' Stream Char'. O(n) Convert a ' Stream Char' into a x, using the given  chunk size. O(n) Convert a ' Stream Char' into a x, 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 count0 function returns the number of times the query & element appears in the given stream.  GHC experimentalSbos@serpentine.com, rtharper@aftereternity.co.uk, duncan@haskell.org]zO(n) Convert a  into a x. *This function is subject to array fusion. {O(n) Convert a x into a .  Subject to array fusion. |}O(c) Convert a list of strict  s into a lazy x. ~O(n) Convert a lazy x into a list of strict  s. O(n\c)/ Appends one x to another. Subject to array  fusion. O(1)+ Returns the first character and rest of a x, or  $ if empty. Subject to array fusion. O(1)" Returns the first character of a x, which must be & non-empty. Subject to array fusion. O(1), Returns all characters after the head of a x, which . must be non-empty. Subject to array fusion. O(1)) Returns all but the last character of a x , which must ) be non-empty. Subject to array fusion. O(1) Tests whether a x$ is empty or not. Subject to array  fusion. O(1)! Returns the last character of a x, which must be & non-empty. Subject to array fusion. O(n)  f t is the x obtained by applying f to  each element of t. Subject to array fusion. O(n) The  function takes a x and a list of  x: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 x. Subject to array fusion. O(n)6 Left-justify a string to the given length, using the E specified fill character on the right. Subject to fusion. Examples: ) justifyLeft 7 'x' "foo" == "fooxxxx" ( justifyLeft 3 'x' "foobar" == "foobar" O(n)7 Right-justify a string to the given length, using the 1 specified fill character on the left. Examples: * justifyRight 7 'x' "bar" == "xxxxbar" ) justifyRight 3 'x' "foobar" == "foobar" O(n)0 Center a string to the given length, using the 4 specified fill character on either side. Examples:  center 8 'x' "HS" = "xxxHSxxx" O(n) The * function transposes the rows and columns  of its x) argument. Note that this function uses z,  {:, and the list version of transpose, and is thus not very  efficient. O(n)  t returns the elements of t in reverse order.  O(m)*O(n)9 Replace every occurrence of one substring with another. Text to search for Replacement text  Input text 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 x,  reduces the x0 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 x. 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 x,  reduces the x0 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 x. Subject to array  fusion. O(n) Concatenate a list of xs. Subject to array fusion. O(n) Map a function over a x that results in a x, 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  x t satisifes the predicate p. Subject to array fusion. O(n)  p t* determines whether all characters in the  x t satisify the predicate p. Subject to array fusion. O(n) " returns the maximum value from a x, which - must be non-empty. Subject to array fusion. O(n) " returns the minimum value from a x, 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 x, passing an accumulating 3 parameter from left to right, and returns a final x. The ( function behaves like a combination of  and  -; it applies a function to each element of a x , passing E an accumulating parameter from right to left, and returning a final 1 value of this accumulator together with the new x. O(n*m)  n t is a x consisting of the input  t repeated n times. Subject to fusion. O(n)  n c is a x 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  x7 from a seed value. The function takes the element and  returns  if it is done producing the x , 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 x 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 x, returns the prefix of the  x of length n , or the x itself if n is greater than , the length of the Text. Subject to fusion. O(n)  n, applied to a x, returns the suffix of the  x of length n, or the empty x if n is greater than the  length of the x. Subject to fusion. O(n) , applied to a predicate p and a x , returns > the longest prefix (possibly empty) of elements that satisfy p. + This function is subject to array fusion. O(n)  p t$ returns the suffix remaining after   p t,. This function is subject to array fusion. O(n)  p t$ returns the prefix remaining after - dropping characters that fail the predicate p from the end of  t.  Examples: ( dropWhileEnd (=='.') "foo..." == "foo" O(n)  p t' returns the substring remaining after - dropping characters that fail the predicate p from both the  beginning and end of t. Subject to fusion. O(n); Remove leading white space from a string. Equivalent to:  dropWhile isSpace O(n)< Remove trailing white space from a string. Equivalent to:  dropWhileEnd isSpace O(n)8 Remove leading and trailing white space from a string.  Equivalent to:  dropAround isSpace 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 x and returns a list of xs 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 x,  shortest first. O(n)( Return all final segments of the given x , longest  first.  O(m)*O(n) Break a x$ into pieces separated by the first  x; argument, consuming the delimiter. An empty delimiter is 0 invalid, and will cause an error to be raised.  Examples:  6 split "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"] 8 split "aaa" "aaaXaaaXaaaXaaa" == ["","X","X","X",""] , split "x" "x" == ["",""] and ' intercalate s . split s == id 4 split (singleton c) == splitWith (==c) Text to split on  Input text  O(m)*O(n) Break a x into pieces at most k times,  treating the first x( argument as the delimiter to break on, E and consuming the delimiter. The last element of the list contains @ the remaining text after the number of times to split has been ' reached. A value of zero or less for k causes no splitting to C occur. An empty delimiter is invalid, and will cause an error to  be raised.  Examples:  1 splitTimes 0 "//" "a//b//c" == ["a//b//c"] 7 splitTimes 2 ":" "a:b:c:d:e" == ["a","b","c:d:e"] 0 splitTimes 100 "???" "a????b" == ["a","?b"] and ( intercalate s . splitTimes k s == id !Maximum number of times to split Text to split on  Input text  O(m)*O(n) Break a x into pieces at most k times, like  7, but start from the end of the input and work towards  the start.  Examples: = splitTimes 2 "::" "a::b::c::d::e" == ["a","b","c::d::e"] = splitTimesEnd 2 "::" "a::b::c::d::e" == ["a::b::c","d","e"] !Maximum number of times to split Text to split on  Input text O(n) Splits a x* 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) Splits a x into components of length k . The last @ element may be shorter than the other chunks, depending on the  length of the input. Examples: 1 chunksOf 3 "foobarbaz" == ["foo","bar","baz"] 3 chunksOf 4 "haskell.org" == ["hask","ell.","org"] O(n) Breaks a x up into a list of xs at  newline 2s. The resulting strings do not contain newlines. O(n) Breaks a x' 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 xs and returns  0< iff the first is a prefix of the second. This function is  subject to fusion. O(n) The  function takes two xs and returns  0* iff the first is a suffix of the second. O(n) The  function takes two xs and returns  09 iff the first is contained, wholly and intact, anywhere  within the second. O(n)  is the x membership predicate. O(n) , applied to a predicate and a x,  returns a x. containing those characters that satisfy the  predicate. O(n) The " function takes a predicate and a x, = 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 x,  and returns the pair of x$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) x. index (subscript) operator, starting from 0. O(n) The " function takes a predicate and a x 3 and returns the index of the first element in the x 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 x) 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 x which is equal to the query . element. This function is subject to fusion. O(n*m) The * function returns the number of times the # query string appears in the given x. An empty query string is 0 invalid, and will cause an error to be raised. O(n) The * function returns the number of times the $ query element appears in the given x. This function is subject  to fusion. O(n)  takes two xs and returns a list of , corresponding pairs of bytes. If one input x is short,  excess elements of the longer x 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. [xyz{|}~[xz{|y}~Yz{|}~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:;<=>?@ABCDEFGHI"JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~#$9:;<=>@?BCDAEFGHMNOPI"JKLQRSTUVWXYZ[\]^_`abcdefghijklmnoprqtsuvwxyz{|}~&'($   ; < = > ? @ A B C D F H J K L Q R S T U V G W X Y Z [ \ ] e g h i j  | }  E$#EIf?B       e !"#Ef$%&text-0.4Data.Text.Encoding.Error Data.TextData.Text.EncodingData.Text.ForeignData.Text.LazyData.Text.Lazy.EncodingData.Text.Fusion.InternalData.Text.Fusion.CaseMappingData.Text.Encoding.Utf32Data.Text.UnsafeShiftData.Text.Encoding.Utf8Data.Text.Encoding.Utf16Data.Text.Fusion.CommonData.Text.ArrayData.Text.InternalData.Text.UnsafeCharData.Text.Fusion Data.Text.Encoding.Fusion.CommonData.Text.UnsafeData.Text.Encoding.FusionData.Text.Lazy.Encoding.FusionData.Text.Lazy.InternalData.Text.Lazy.FusionUnicodeException EncodeError DecodeError OnEncodeError OnDecodeErrorOnError strictDecode lenientDecode strictEncodeignorereplaceTextempty decodeASCIIdecodeUtf8With decodeUtf8 encodeUtf8decodeUtf16LEWith decodeUtf16LEdecodeUtf16BEWith decodeUtf16BE encodeUtf16LE encodeUtf16BEdecodeUtf32LEWith decodeUtf32LEdecodeUtf32BEWith decodeUtf32BE encodeUtf32LE encodeUtf32BEfromPtr lengthWord16unsafeCopyToPtruseAsPtrpackunpack singletonconssnocappendheadunconslasttailinitnulllengthmap intercalate interspersereverse toCaseFoldtoLowertoUpper justifyLeft justifyRightcenter transposefoldlfoldl'foldl1foldl1'foldrfoldr1concat concatMapanyallmaximumminimumscanlscanl1scanrscanr1 mapAccumL mapAccumR replicate replicateCharunfoldrunfoldrNtakedrop takeWhile dropWhile dropWhileEnd dropAround stripStartstripEndstripsplitAtspanbreakgroupBygroupinitstailssplit splitTimes splitTimesEnd splitWithchunksOfelemfind partitionfilterindex findIndex findIndices elemIndex elemIndicescountzipzipWithwordslinesunlinesunwords isPrefixOf isSuffixOf isInfixOf fromChunkstoChunksStreamStepYieldSkipDoneSwitchS2S1PairS:!:SM8MJNeqcmp upperMapping lowerMapping foldMappingvalidate UnsafeShiftshiftLshiftRbetweenord2ord3ord4chr2chr3chr4 validate1 validate2 validate3 validate4baseGHC.BaseString Data.MaybeNothingJustGHC.Errerror GHC.ExceptionthrowshowUnicodeException streamList unstreamListlengthI caseConvert justifyLeftIreplicateCharI replicateI unfoldrNIghc-primGHC.BoolTrueindexI findIndexI findIndicesI elemIndexI elemIndicesI countCharI streamError emptyError internalErrorElt bytesInArray unsafeIndex unsafeRead unsafeWritereadwriteIArrayMArrayArrayarrayTcmArrayTccheck wORD16_SCALE unsafeNew unsafeFreezenewtoListrunrun2copy unsafeCopytexttextPshowTextGHC.Showshow unsafeChr unsafeChr8 unsafeChr32stream reverseStreamunstream reverseScanrfindIndexOrEnd countChar restreamUtf8restreamUtf16BErestreamUtf16LErestreamUtf32BErestreamUtf32LE unsafeHeadGHC.List unsafeTailiteriter_ reverseIter streamASCII streamUtf8bytestring-0.9.1.8Data.ByteString.Internal ByteString streamUtf16LE streamUtf16BE streamUtf32BE streamUtf32LEGHC.WordWord8 decodeError unknownLengthData.ByteString.Lazy.InternalunstreamChunksGHC.PtrPtrWord16second Data.List GHC.TypesCharfindAIndexOrEndChunkEmpty invariant showStructurecheckInvariantchunk foldrChunks foldlChunksdefaultChunkSizesmallChunkSize chunkOverhead revChunksimpossibleError