diff options
author | Simon Jakobi <simon.jakobi@gmail.com> | 2019-04-29 04:49:33 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-09-24 13:09:09 -0400 |
commit | b1c4116d2df21dcb2a6ac6b1b70a226286d54203 (patch) | |
tree | 976a905e32d251e37bf3f50b7bcf348094555525 | |
parent | d4d44edbe4f9acbd523b3cc049f9a6ac3f7f0ddd (diff) | |
download | haskell-b1c4116d2df21dcb2a6ac6b1b70a226286d54203.tar.gz |
Deprecate Data.Semigroup.Option
Libraries email: https://mail.haskell.org/pipermail/libraries/2018-April/028724.html
GHC issue: https://gitlab.haskell.org/ghc/ghc/issues/15028
Corresponding PRs for deepseq:
* https://github.com/haskell/deepseq/pull/55
* https://github.com/haskell/deepseq/pull/57
Bumps the deepseq submodule.
(cherry picked from commit a90d13091ff82e954432bedd0bb20845c666eddb)
-rw-r--r-- | libraries/base/Data/Semigroup.hs | 9 | ||||
-rw-r--r-- | libraries/base/changelog.md | 3 | ||||
m--------- | libraries/deepseq | 0 |
3 files changed, 6 insertions, 6 deletions
diff --git a/libraries/base/Data/Semigroup.hs b/libraries/base/Data/Semigroup.hs index fde9706416..e62523c327 100644 --- a/libraries/base/Data/Semigroup.hs +++ b/libraries/base/Data/Semigroup.hs @@ -350,8 +350,6 @@ instance Bifoldable Arg where instance Bitraversable Arg where bitraverse f g (Arg a b) = Arg <$> f a <*> g b --- | Use @'Option' ('First' a)@ to get the behavior of --- 'Data.Monoid.First' from "Data.Monoid". newtype First a = First { getFirst :: a } deriving ( Bounded -- ^ @since 4.9.0.0 , Eq -- ^ @since 4.9.0.0 @@ -408,8 +406,6 @@ instance Monad First where instance MonadFix First where mfix f = fix (f . getFirst) --- | Use @'Option' ('Last' a)@ to get the behavior of --- 'Data.Monoid.Last' from "Data.Monoid" newtype Last a = Last { getLast :: a } deriving ( Bounded -- ^ @since 4.9.0.0 , Eq -- ^ @since 4.9.0.0 @@ -514,6 +510,8 @@ mtimesDefault n x | n == 0 = mempty | otherwise = unwrapMonoid (stimes n (WrapMonoid x)) +{-# DEPRECATED Option, option "will be removed in GHC 9.2; use 'Maybe' instead." #-} + -- | 'Option' is effectively 'Maybe' with a better instance of -- 'Monoid', built off of an underlying 'Semigroup' instead of an -- underlying 'Monoid'. @@ -523,8 +521,7 @@ mtimesDefault n x -- -- In GHC 8.4 and higher, the 'Monoid' instance for 'Maybe' has been -- corrected to lift a 'Semigroup' instance instead of a 'Monoid' --- instance. Consequently, this type is no longer useful. It will be --- marked deprecated in GHC 8.8 and removed in GHC 8.10. +-- instance. Consequently, this type is no longer useful. newtype Option a = Option { getOption :: Maybe a } deriving ( Eq -- ^ @since 4.9.0.0 , Ord -- ^ @since 4.9.0.0 diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index be86901ff4..34b1a8d1bf 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -14,6 +14,9 @@ * The planned deprecation of `Data.Monoid.First` and `Data.Monoid.Last` is scrapped due to difficulties with the suggested migration path. + * `Data.Semigroup.Option` and the accompanying `option` function are + deprecated and scheduled for removal in 4.16. + * Add `Generic` instances to `Fingerprint`, `GiveGCStats`, `GCFlags`, `ConcFlags`, `DebugFlags`, `CCFlags`, `DoHeapProfile`, `ProfFlags`, `DoTrace`, `TraceFlags`, `TickyFlags`, `ParFlags`, `RTSFlags`, `RTSStats`, diff --git a/libraries/deepseq b/libraries/deepseq -Subproject 13c1c84415da727ab56e9fa33aca5046b668384 +Subproject b8c4fb4debaed6ef7eb6940ca4cfea6bd63cc21 |