[Git][ghc/ghc][master] 6 commits: docs(NonEmpty/group): Remove incorrect haddock link quotes in code block

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sun Dec 3 05:10:44 UTC 2023



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


Commits:
010fb784 by Owen Shepherd at 2023-12-03T00:10:09-05:00
docs(NonEmpty/group): Remove incorrect haddock link quotes in code block

- - - - -
cda9c12d by Owen Shepherd at 2023-12-03T00:10:09-05:00
docs(NonEmpty/group): Remove cycle from group haddock example

- - - - -
495265b9 by Owen Shepherd at 2023-12-03T00:10:09-05:00
docs(NonEmpty/group): Use repl haddock syntax in group docs

- - - - -
d134d1de by Owen Shepherd at 2023-12-03T00:10:09-05:00
docs(NonEmpty/group): Use list [] notation in group haddock

- - - - -
dfcf629c by Owen Shepherd at 2023-12-03T00:10:10-05:00
docs(NonEmpty/group): Specify final property of group function in haddock

- - - - -
cad3b734 by Owen Shepherd at 2023-12-03T00:10:10-05:00
fix: Add missing property of List.group

- - - - -


2 changed files:

- libraries/base/src/Data/List/NonEmpty.hs
- libraries/base/src/Data/OldList.hs


Changes:

=====================================
libraries/base/src/Data/List/NonEmpty.hs
=====================================
@@ -398,10 +398,12 @@ partition p = List.partition p . toList
 -- | The 'group' function takes a stream and returns a list of
 -- streams such that flattening the resulting list is equal to the
 -- argument.  Moreover, each stream in the resulting list
--- contains only equal elements.  For example, in list notation:
+-- contains only equal elements, and consecutive equal elements
+-- of the input end up in the same stream of the output list.
+-- For example, in list notation:
 --
--- > 'group' $ 'cycle' "Mississippi"
--- >   = "M" : "i" : "ss" : "i" : "ss" : "i" : "pp" : "i" : "M" : "i" : ...
+-- >>> group "Mississippi"
+-- ["M", "i", "ss", "i", "ss", "i", "pp", "i"]
 group :: (Foldable f, Eq a) => f a -> [NonEmpty a]
 group = groupBy (==)
 


=====================================
libraries/base/src/Data/OldList.hs
=====================================
@@ -1360,8 +1360,9 @@ deleteFirstsBy eq       =  foldl (flip (deleteBy eq))
 
 -- | 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.
+-- each sublist in the result is non-empty, all elements are equal to the
+-- first one, and consecutive equal elements of the input end up in the
+-- same element of the output list.
 --
 -- 'group' is a special case of 'groupBy', which allows the programmer to supply
 -- their own equality test.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd8acc0c6a90971f9d70eda9bc7204470bfb49f7...cad3b734ab9fe2e45505de7f13f676aeb539d6d8

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd8acc0c6a90971f9d70eda9bc7204470bfb49f7...cad3b734ab9fe2e45505de7f13f676aeb539d6d8
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/20231203/e15ffb15/attachment-0001.html>


More information about the ghc-commits mailing list