:: Eq a => [a] -> [[a]] package:LambdaHack

The group function takes a list and returns a list of lists such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result is non-empty and all elements are equal to the first one. For example,
>>> group "Mississippi"
["M","i","ss","i","ss","i","pp","i"]
group is a special case of groupBy, which allows the programmer to supply their own equality test. It's often preferable to use Data.List.NonEmpty.group, which provides type-level guarantees of non-emptiness of inner lists.
The inits function returns all initial segments of the argument, shortest first. For example,
>>> inits "abc"
["","a","ab","abc"]
Note that inits has the following strictness property: inits (xs ++ _|_) = inits xs ++ _|_ In particular, inits _|_ = [] : _|_ inits is semantically equivalent to map reverse . scanl (flip (:)) [], but under the hood uses a queue to amortize costs of reverse.
The tails function returns all final segments of the argument, longest first. For example,
>>> tails "abc"
["abc","bc","c",""]
Note that tails has the following strictness property: tails _|_ = _|_ : _|_
The subsequences function returns the list of all subsequences of the argument.
>>> subsequences "abc"
["","a","b","ab","c","ac","bc","abc"]
This function is productive on infinite inputs:
>>> take 8 $ subsequences ['a'..]
["","a","b","ab","c","ac","bc","abc"]
The permutations function returns the list of all permutations of the argument.
>>> permutations "abc"
["abc","bac","cba","bca","cab","acb"]
The permutations function is maximally lazy: for each n, the value of permutations xs starts with those permutations that permute take n xs and keep drop n xs. This function is productive on infinite inputs:
>>> take 6 $ map (take 3) $ permutations ['a'..]
["abc","bac","cba","bca","cab","acb"]
Note that the order of permutations is not lexicographic. It satisfies the following property:
map (take n) (take (product [1..n]) (permutations ([1..n] ++ undefined))) == permutations [1..n]