# Ord a => [a] -> [a]

The sort function implements a stable sorting algorithm. It is a special case of sortBy, which allows the programmer to supply their own comparison function.
The insert function takes an element and a list and inserts the element into the list at the last position or equal to the next element. In particular, if the list is sorted before the call, the result will also be sorted. It is a special case of insertBy, which allows the programmer to supply their own comparison function.
cycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.
Return all the elements of a list except the last one. The list must be non-empty.
reverse xs returns the elements of xs in reverse order. xs must be finite.
Extract the elements after the head of a list, which must be non-empty.
maximum returns the maximum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of maximumBy, which allows the programmer to supply their own comparison function.
minimum returns the minimum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of minimumBy, which allows the programmer to supply their own comparison function.
A list producer that can be fused with foldr. This function is merely > augment g xs = g (:) xs but GHC's simplifier will transform an expression of the form foldr k z (augment g xs), which may arise after inlining, to g k (foldr k z xs), which avoids producing an intermediate list.
The sortWith function sorts a list of elements using the user supplied function to project something out of each element
scanl1 is a variant of scanl that has no starting value argument: > scanl1 f [x1, x2, ...] == [x1, x1 f x2, ...]
scanr1 is a variant of scanr that has no starting value argument.
The sortBy function is the non-overloaded version of sort.
The nubBy function behaves just like nub, except it uses a user-supplied equality predicate instead of the overloaded == function.
dropWhile p xs returns the suffix remaining after takeWhile p xs: > dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3] > dropWhile (< 9) [1,2,3] == [] > dropWhile (< 0) [1,2,3] == [1,2,3]
filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e., > filter p xs = [ x | x <- xs, p x]
takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p: > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] > takeWhile (< 9) [1,2,3] == [1,2,3] > takeWhile (< 0) [1,2,3] == []
The genericDrop function is an overloaded version of drop, which accepts any Integral value as the number of elements to drop.
The genericTake function is an overloaded version of take, which accepts any Integral value as the number of elements to take.
The intersperse function takes an element and a list and intersperses' that element between the elements of the list. For example, > intersperse ',' "abcde" == "a,b,c,d,e"
drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs: > drop 6 "Hello World!" == "World!" > drop 3 [1,2,3,4,5] == [4,5] > drop 3 [1,2] == [] > drop 3 [] == [] > drop (-1) [1,2] == [1,2] > drop 0 [1,2] == [1,2] It is an instance of the more general Data.List.genericDrop, in which n may be of any integral type.
take n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs: > take 5 "Hello World!" == "Hello" > take 3 [1,2,3,4,5] == [1,2,3] > take 3 [1,2] == [1,2] > take 3 [] == [] > take (-1) [1,2] == [] > take 0 [1,2] == [] It is an instance of the more general Data.List.genericTake, in which n may be of any integral type.
Append two lists, i.e., > [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] > [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...] If the first list is not finite, the result is the first list.
intercalate xs xss is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.
O(n^2). The nub function removes duplicate elements from a list. In particular, it keeps only the first occurrence of each element. (The name nub means essence'.) It is a special case of nubBy, which allows the programmer to supply their own equality test.
The inits function returns all initial segments of the argument, shortest first. For example, > inits "abc" == ["","a","ab","abc"]
The permutations function returns the list of all permutations of the argument. > permutations "abc" == ["abc","bac","cba","bca","cab","acb"]
The subsequences function returns the list of all subsequences of the argument. > subsequences "abc" == ["","a","b","ab","c","ac","bc","abc"]
The tails function returns all final segments of the argument, longest first. For example, > tails "abc" == ["abc", "bc", "c",""]
List of elements of a structure.
Concatenate a list of lists.
The concatenation of all the elements of a container of lists.
The largest element of a non-empty structure.
The least element of a non-empty structure.
Extract the first element of a list, which must be non-empty.
Extract the last element of a list, which must be finite and non-empty.
The transpose function transposes the rows and columns of its ByteString argument.
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.
repeat x is an infinite list, with x the value of every element.
Returns no shrinking alternatives.
The deleteBy function behaves like delete, but takes a user-supplied equality predicate.
The deleteFirstsBy function takes a predicate and two lists and returns the first list with the first occurrence of each element of the second list removed.
The intersectBy function is the non-overloaded version of intersect.
The unionBy function is the non-overloaded version of union.
Gets the module of a type constructor: take *.*.*... before name
Gets the unqualified type constructor: drop *.*.*... before name
Case normalization; cf. RFC3986 section 6.2.2.1 NOTE: authority case normalization is not performed
Encoding normalization; cf. RFC3986 section 6.2.2.2
Path segment normalization; cf. RFC3986 section 6.2.2.4
Processing Strings into Html friendly things.
Simplifies the input string by interpreting \r and \b characters specially so that the result string has the same final (or terminal, pun intended) appearance as would the input string when written to a terminal that overwrites character positions following carriage returns and backspaces.
Turns all instances of escaped characters in the string back into literal characters.
Converts a single value from the application/x-www-form-urlencoded encoding.
Converts a single value to the application/x-www-form-urlencoded encoding.
Add a trailing file path separator if one is not already present. > hasTrailingPathSeparator (addTrailingPathSeparator x) > hasTrailingPathSeparator x ==> addTrailingPathSeparator x == x > Posix: addTrailingPathSeparator "test/rest" == "test/rest/"
Delete the drive, if it exists. > dropDrive x == snd (splitDrive x)
Remove last extension, and the "." preceding it. > dropExtension x == fst (splitExtension x)
Drop all extensions > not \$ hasExtension (dropExtensions x)
Drop the filename. > dropFileName x == fst (splitFileName x)
Remove any trailing path separators > dropTrailingPathSeparator "file/test/" == "file/test" > Posix: not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x > Posix: dropTrailingPathSeparator "/" == "/" > Windows: dropTrailingPathSeparator "\\" == "\\"
Take a FilePath and make it valid; does not change already valid FilePaths. > isValid (makeValid x) > isValid x ==> makeValid x == x > makeValid "" == "_" > Windows: makeValid "c:\\test:of_test" == "c:\\test_of_test" > Windows: makeValid "test*" == "test_" > Windows: makeValid "c:\\test\\nul" == "c:\\test\\nul_" > Windows: makeValid "c:\\test\\prn.txt" == "c:\\test\\prn_.txt" > Windows: makeValid "c:\\test/prn.txt" == "c:\\test/prn_.txt" > Windows: makeValid "c:\\nul\\file" == "c:\\nul_\\file"
Normalise a file * // outside of the drive can be made blank * / -> pathSeparator * ./ -> "" > Posix: normalise "/file/\\test////" == "/file/\\test/" > Posix: normalise "/file/./test" == "/file/test" > Posix: normalise "/test/file/../bob/fred/" == "/test/file/../bob/fred/" > Posix: normalise "../bob/fred/" == "../bob/fred/" > Posix: normalise "./bob/fred/" == "bob/fred/" > Windows: normalise "c:\\file/bob\\" == "C:\\file\\bob\\" > Windows: normalise "c:\\" == "C:\\" > Windows: normalise "\\\\server\\test" == "\\\\server\\test" > Windows: normalise "c:/file" == "C:\\file" > normalise "." == "." > Posix: normalise "./" == "./" > Posix: normalise "./." == "./" > Posix: normalise "/" == "/" > Posix: normalise "bob/fred/." == "bob/fred/"
Get the directory name, move up one level. > takeDirectory x isPrefixOf x || takeDirectory x == "." > takeDirectory "foo" == "." > takeDirectory "/foo/bar/baz" == "/foo/bar" > takeDirectory "/foo/bar/baz/" == "/foo/bar/baz" > takeDirectory "foo/bar/baz" == "foo/bar" > Windows: takeDirectory "foo\\bar" == "foo" > Windows: takeDirectory "foo\\bar\\\\" == "foo\\bar" > Windows: takeDirectory "C:\\" == "C:\\"
Get the drive from a filepath. > takeDrive x == fst (splitDrive x)
Get the file name. > takeFileName "test/" == "" > takeFileName x isSuffixOf x > takeFileName x == snd (splitFileName x) > Valid x => takeFileName (replaceFileName x "fred") == "fred" > Valid x => takeFileName (x </> "fred") == "fred" > Valid x => isRelative (takeFileName x)
delete x removes the first occurrence of x from its list argument. For example, > delete 'a' "banana" == "bnana" It is a special case of deleteBy, which allows the programmer to supply their own equality test.
The \\ function is list difference ((non-associative). In the result of xs \\ ys, the first occurrence of each element of ys in turn (if any) has been removed from xs. Thus > (xs ++ ys) \\ xs == ys. It is a special case of deleteFirstsBy, which allows the programmer to supply their own equality test.
The intersect function takes the list intersection of two lists. For example, > [1,2,3,4] intersect [2,4,6,8] == [2,4] If the first list contains duplicates, so will the result. > [1,2,2,3,4] intersect [6,4,4,2] == [2,2,4] It is a special case of intersectBy, which allows the programmer to supply their own equality test.
The union function returns the list union of the two lists. For example, > "dog" union "cow" == "dogcw" Duplicates, and elements of the first list, are removed from the the second list, but if the first list contains duplicates, so will the result. It is a special case of unionBy, which allows the programmer to supply their own equality test.
The groupWith function uses the user supplied function which projects an element out of every list element in order to to first sort the input list and then to form groups by equality on these projected elements
The groupBy function is the non-overloaded version of group.