summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBodigrim <andrew.lelechenko@gmail.com>2020-05-18 15:47:37 -0400
committerBodigrim <andrew.lelechenko@gmail.com>2020-05-18 15:47:37 -0400
commitc6704f23b64b33888e7c6c9bae2d9db79b4beabd (patch)
tree33326d816cb61c160ba016079475cb169cb91b86
parent568d7279a80cf945271f0659f11a94eea3f1433d (diff)
downloadhaskell-c6704f23b64b33888e7c6c9bae2d9db79b4beabd.tar.gz
Clarify description of fromListN
-rwxr-xr-xlibraries/base/GHC/Exts.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/libraries/base/GHC/Exts.hs b/libraries/base/GHC/Exts.hs
index 894ffad509..89765028b8 100755
--- a/libraries/base/GHC/Exts.hs
+++ b/libraries/base/GHC/Exts.hs
@@ -176,11 +176,12 @@ class IsList l where
-- list of @Item l@
fromList :: [Item l] -> l
- -- | The 'fromListN' function takes the input list's length as a hint. Its
- -- behaviour should be equivalent to 'fromList'. The hint can be used to
- -- construct the structure @l@ more efficiently compared to 'fromList'. If
- -- the given hint does not equal to the input list's length the behaviour of
- -- 'fromListN' is not specified.
+ -- | The 'fromListN' function takes the input list's length and potentially
+ -- uses it to construct the structure @l@ more efficiently compared to
+ -- 'fromList'. If the given number does not equal to the input list's length
+ -- the behaviour of 'fromListN' is not specified.
+ --
+ -- prop> fromListN (length xs) == fromList xs
fromListN :: Int -> [Item l] -> l
fromListN _ = fromList