[Git][ghc/ghc][wip/sjakobi/deprecate-option-v2] Deprecate Data.Semigroup.Option

Simon Jakobi gitlab at gitlab.haskell.org
Fri Jun 19 23:31:21 UTC 2020



Simon Jakobi pushed to branch wip/sjakobi/deprecate-option-v2 at Glasgow Haskell Compiler / GHC


Commits:
2d5f22c8 by Simon Jakobi at 2020-06-20T01:31:06+02:00
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 PR for deepseq: https://github.com/haskell/deepseq/pull/55

Bumps the deepseq submodule.

- - - - -


3 changed files:

- libraries/base/Data/Semigroup.hs
- libraries/base/changelog.md
- libraries/deepseq


Changes:

=====================================
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 8.14; 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


=====================================
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`,


=====================================
libraries/deepseq
=====================================
@@ -1 +1 @@
-Subproject commit 13c1c84415da727ab56e9fa33aca5046b6683848
+Subproject commit 0ade68f6f54d621132e9bb5f9e3c5fe01f45091f



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2d5f22c88afc62e9d4b53aeb0b5b60ae6fe0f6ea
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/20200619/b34d0ede/attachment-0001.html>


More information about the ghc-commits mailing list