summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorjwaldmann <johannes.waldmann@htwk-leipzig.de>2022-10-11 17:51:56 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-10-11 18:02:59 -0400
commit9c099387ae82b7bf91232b714a3d35f429d6ffe3 (patch)
tree783ebbf4b6a6d98880ad6739cc86ba407ec61cb4 /libraries
parentda679f2eda0f920afa522ce9c4b9ad50cdec7d74 (diff)
downloadhaskell-9c099387ae82b7bf91232b714a3d35f429d6ffe3.tar.gz
Expand comment for Data.List.permutations
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/Data/OldList.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/libraries/base/Data/OldList.hs b/libraries/base/Data/OldList.hs
index 4ba0a8e4df..240292f95b 100644
--- a/libraries/base/Data/OldList.hs
+++ b/libraries/base/Data/OldList.hs
@@ -1246,6 +1246,9 @@ nonEmptySubsequences (x:xs) = [x] : foldr f [] (nonEmptySubsequences xs)
-- >>> 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'..]