[Git][ghc/ghc][master] 2 commits: Clarify description of fromListN

Marge Bot gitlab at gitlab.haskell.org
Mon Jun 1 10:35:46 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
aab606e4 by Bodigrim at 2020-06-01T06:35:36-04:00
Clarify description of fromListN
- - - - -
7e5220e2 by Bodigrim at 2020-06-01T06:35:36-04:00
Apply suggestion to libraries/base/GHC/Exts.hs
- - - - -


1 changed file:

- libraries/base/GHC/Exts.hs


Changes:

=====================================
libraries/base/GHC/Exts.hs
=====================================
@@ -184,11 +184,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) xs == fromList xs
   fromListN :: Int -> [Item l] -> l
   fromListN _ = fromList
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f945eea569993a4e5ed953f4573e6eab785f309f...7e5220e25baedfa7ae0ec055c03cb4429dd1af05

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f945eea569993a4e5ed953f4573e6eab785f309f...7e5220e25baedfa7ae0ec055c03cb4429dd1af05
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200601/9c77f60a/attachment.html>


More information about the ghc-commits mailing list