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"]
Show more results