permutations is:exact

The permutations function returns the list of all permutations of the argument. 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]

Laziness

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.

Examples

>>> permutations "abc"
["abc","bac","cba","bca","cab","acb"]
>>> permutations [1, 2]
[[1,2],[2,1]]
>>> permutations []
[[]]
This function is productive on infinite inputs:
>>> take 6 $ map (take 3) $ permutations ['a'..]
["abc","bac","cba","bca","cab","acb"]
The permutations function returns the list of all permutations of the argument.
The permutations function returns the list of all permutations of the argument. Since: 4.20.0.0
The permutations function returns the list of all permutations of the argument.
>>> permutations "abc"
["abc","bac","cba","bca","cab","acb"]
permutations returns a list of all permutations of the argument.
> permutations "abc"
["abc","bac","cba","bca","cab","acb"]
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]
Generate an infinite list of all finite (such that only finite number of elements change their positions) permutations of the argument.
>>> take 6 (fmap (take 3) (permutations (0...)))
[[0,1,2],[1,0,2],[2,1,0],[1,2,0],[2,0,1],[0,2,1]]
Not on Stackage, so not searched. Permutations of finite sets
O(n!). Returns the list of all permutations of the argument.
>>> permutations mempty
Slist {sList = [Slist {sList = [], sSize = Size 0}], sSize = Size 1}

>>> permutations $ slist "abc"
Slist {sList = [Slist {sList = "abc", sSize = Size 3},Slist {sList = "bac", sSize = Size 3},Slist {sList = "cba", sSize = Size 3},Slist {sList = "bca", sSize = Size 3},Slist {sList = "cab", sSize = Size 3},Slist {sList = "acb", sSize = Size 3}], sSize = Size 6}