summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Jakobi <simon.jakobi@gmail.com>2020-04-25 16:44:20 +0200
committerSimon Jakobi <simon.jakobi@gmail.com>2020-05-25 23:50:05 +0200
commit7b5b6a5d1f52315d36719c69eba62146a81ee2b1 (patch)
treeab60e1fe5f00a3c364871f0b87b3fb04ae8c243a
parentb8c014ce27c279e0d506d5391a4e9bfa7f1c31f2 (diff)
downloadhaskell-wip/sjakobi/undeprecate-first-last.tar.gz
base: Scrap deprecation plan for Data.Monoid.{First,Last}wip/sjakobi/undeprecate-first-last
See the discussion on the libraries mailing list for context: https://mail.haskell.org/pipermail/libraries/2020-April/030357.html
-rw-r--r--libraries/base/Data/Monoid.hs20
-rw-r--r--libraries/base/changelog.md3
2 files changed, 3 insertions, 20 deletions
diff --git a/libraries/base/Data/Monoid.hs b/libraries/base/Data/Monoid.hs
index f8925cbfb7..479dac88f5 100644
--- a/libraries/base/Data/Monoid.hs
+++ b/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
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 06b9a108ef..68ea4670ce 100644
--- a/libraries/base/changelog.md
+++ b/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`,