[Git][ghc/ghc][master] base: Scrap deprecation plan for Data.Monoid.{First,Last}

Marge Bot gitlab at gitlab.haskell.org
Fri May 29 05:40:44 UTC 2020



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


Commits:
f44d7ae0 by Simon Jakobi at 2020-05-29T01:40:34-04:00
base: Scrap deprecation plan for Data.Monoid.{First,Last}

See the discussion on the libraries mailing list for context:

https://mail.haskell.org/pipermail/libraries/2020-April/030357.html

- - - - -


2 changed files:

- libraries/base/Data/Monoid.hs
- libraries/base/changelog.md


Changes:

=====================================
libraries/base/Data/Monoid.hs
=====================================
@@ -129,16 +129,6 @@ import Data.Semigroup.Internal
 --
 -- >>> getFirst (First (Just "hello") <> First Nothing <> First (Just "world"))
 -- Just "hello"
---
--- Use of this type is discouraged. Note the following equivalence:
---
--- > Data.Monoid.First x === Maybe (Data.Semigroup.First x)
---
--- In addition to being equivalent in the structural sense, the two
--- also have 'Monoid' instances that behave the same. This type will
--- be marked deprecated in GHC 8.8, and removed in GHC 8.10.
--- Users are advised to use the variant from "Data.Semigroup" and wrap
--- it in 'Maybe'.
 newtype First a = First { getFirst :: Maybe a }
         deriving ( Eq          -- ^ @since 2.01
                  , Ord         -- ^ @since 2.01
@@ -168,16 +158,6 @@ instance Monoid (First a) where
 --
 -- >>> getLast (Last (Just "hello") <> Last Nothing <> Last (Just "world"))
 -- Just "world"
---
--- Use of this type is discouraged. Note the following equivalence:
---
--- > Data.Monoid.Last x === Maybe (Data.Semigroup.Last x)
---
--- In addition to being equivalent in the structural sense, the two
--- also have 'Monoid' instances that behave the same. This type will
--- be marked deprecated in GHC 8.8, and removed in GHC 8.10.
--- Users are advised to use the variant from "Data.Semigroup" and wrap
--- it in 'Maybe'.
 newtype Last a = Last { getLast :: Maybe a }
         deriving ( Eq          -- ^ @since 2.01
                  , Ord         -- ^ @since 2.01


=====================================
libraries/base/changelog.md
=====================================
@@ -11,6 +11,9 @@
 
   * Add `singleton` function for `Data.List.NonEmpty`.
 
+  * The planned deprecation of `Data.Monoid.First` and `Data.Monoid.Last`
+    is scrapped due to difficulties with the suggested migration path.
+
   * Add `Generic` instances to `Fingerprint`, `GiveGCStats`, `GCFlags`,
     `ConcFlags`, `DebugFlags`, `CCFlags`, `DoHeapProfile`, `ProfFlags`,
     `DoTrace`, `TraceFlags`, `TickyFlags`, `ParFlags`, `RTSFlags`, `RTSStats`,



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f44d7ae08442ae6227db37cacc97fe0def8017c5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f44d7ae08442ae6227db37cacc97fe0def8017c5
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/20200529/0df955c5/attachment-0001.html>


More information about the ghc-commits mailing list