Ord a => [a] -> [a] -base +text
O(n) The transpose function transposes the rows and columns of its Text argument. Note that this function uses pack, unpack, and the list version of transpose, and is thus not very efficient.
O(n) Concatenate a list of Texts.
O(c) Convert a list of strict Texts into a lazy Text.
O(n) Joins lines, after appending a terminating newline to each.
O(n) Joins words using single space characters.
O(n) Group characters in a string by equality.
The group function takes a Text and returns a list of Texts 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 groupBy, which allows the programmer to supply their own equality test.
O(n) Return all initial segments of the given Text, shortest first.
O(n) Breaks a Text up into a list of Texts at newline Chars. The resulting strings do not contain newlines.
O(n) Return all final segments of the given Text, longest first.
O(n) Convert a lazy Text into a list of strict Texts.
O(n) Breaks a Text up into a list of words, delimited by Chars representing white space.
O(n) The intercalate function takes a Text and a list of Texts and concatenates the list after interspersing the first argument between each element of the list.
O(n) Group characters in a string according to a predicate.
The groupBy function is the non-overloaded version of group.
O(n) Splits a Text into components delimited by separators, The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
> split (=='a') "aabbaca" == ["","","bb","c",""]
> split (=='a') "" == [""]
O(n) Splits a Text into components delimited by separators, The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
> split (=='a') "aabbaca" == ["","","bb","c",""]
> split (=='a') [] == [""]
O(m+n) Break a Text into pieces separated by the first Text argument, consuming the delimiter. An empty delimiter is invalid, and will cause an error to be raised.
Examples:
> splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"]
> splitOn "aaa" "aaaXaaaXaaaXaaa" == ["","X","X","X",""]
> splitOn "x" "x" == ["",""]
and
> intercalate s . splitOn s == id
> splitOn (singleton c) == split (==c)
In (unlikely) bad cases, this function's time complexity degrades towards O(n*m).
O(m+n) Break a Text into pieces separated by the first Text argument, consuming the delimiter. An empty delimiter is invalid, and will cause an error to be raised.
Examples:
> splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"]
> splitOn "aaa" "aaaXaaaXaaaXaaa" == ["","X","X","X",""]
> splitOn "x" "x" == ["",""]
and
> intercalate s . splitOn s == id
> splitOn (singleton c) == split (==c)
This function is strict in its first argument, and lazy in its second.
In (unlikely) bad cases, this function's time complexity degrades towards O(n*m).
O(n) Splits a Text into components of length k. The last element may be shorter than the other chunks, depending on the length of the input. Examples:
> chunksOf 3 "foobarbaz" == ["foo","bar","baz"]
> chunksOf 4 "haskell.org" == ["hask","ell.","org"]
O(n) Splits a Text into components of length k. The last element may be shorter than the other chunks, depending on the length of the input. Examples:
> chunksOf 3 "foobarbaz" == ["foo","bar","baz"]
> chunksOf 4 "haskell.org" == ["hask","ell.","org"]
Map a Char to a Text-safe value.
UTF-16 surrogate code points are not included in the set of Unicode scalar values, but are unfortunately admitted as valid Char values by Haskell. They cannot be represented in a Text. This function remaps those code points to the Unicode replacement character "ý", and leaves other code points unchanged.
O(c) Convert a strict Text into a lazy Text.
O(1) Returns all but the last character of a Text, which must be non-empty. Subject to fusion.
Check the invariant lazily.
O(n) reverse t returns the elements of t in reverse order.
O(n) Reverse the characters of a string. Subject to fusion.
O(n) Remove leading and trailing white space from a string. Equivalent to:
> dropAround isSpace
O(n) Remove trailing white space from a string. Equivalent to:
> dropWhileEnd isSpace
O(n) Remove leading white space from a string. Equivalent to:
> dropWhile isSpace
O(1) Returns all characters after the head of a Text, which must be non-empty. Subject to fusion.
O(n) Convert a string to folded case. This function is mainly 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 toLower 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.
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 toLower to the input string. For instance, the Armenian small ligature men now (U+FB13) is case folded to the bigram men now (U+0574 U+0576), while the micro sign (U+00B5) is case folded to the Greek small letter letter mu (U+03BC) instead of itself.
O(n) Convert a string to lower case, using simple case 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).
O(n) Convert a string to lower case, using simple case conversion. The result string may be longer than the input string. 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) Convert a lazy Text into a strict Text.
O(n) Convert a string to upper case, using simple case 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".
O(n) Convert a string to upper case, using simple case 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.
Consume the chunks of a lazy Text with a strict, tail-recursive, accumulating left fold.
O(n) foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a Text, reduces the Text using the binary operator, from left to right. Subject to fusion.
Show more results