[commit: ghc] ghc-8.2: base: Mark unfold as deprecated (881793e)

git at git.haskell.org git at git.haskell.org
Thu Apr 6 22:29:39 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/881793ec8730a1c98da424bdac0d03dfe77e5c1f/ghc

>---------------------------------------------------------------

commit 881793ec8730a1c98da424bdac0d03dfe77e5c1f
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Apr 4 21:48:49 2017 -0400

    base: Mark unfold as deprecated
    
    Test Plan: Read it
    
    Reviewers: austin, hvr, RyanGlScott
    
    Reviewed By: RyanGlScott
    
    Subscribers: rwbarton, thomie, ekmett
    
    Differential Revision: https://phabricator.haskell.org/D3422
    
    (cherry picked from commit ce9b6170b0ac9ff417000d8e7bdff7b2298f2978)


>---------------------------------------------------------------

881793ec8730a1c98da424bdac0d03dfe77e5c1f
 libraries/base/Data/List/NonEmpty.hs | 2 ++
 libraries/base/changelog.md          | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/libraries/base/Data/List/NonEmpty.hs b/libraries/base/Data/List/NonEmpty.hs
index 2f9f868..9a9de01 100644
--- a/libraries/base/Data/List/NonEmpty.hs
+++ b/libraries/base/Data/List/NonEmpty.hs
@@ -180,6 +180,8 @@ unfold :: (a -> (b, Maybe a)) -> a -> NonEmpty b
 unfold f a = case f a of
   (b, Nothing) -> b :| []
   (b, Just c)  -> b <| unfold f c
+{-# DEPRECATED unfold "Use unfoldr" #-}
+-- Deprecated in 8.2.1, remove in 8.4
 
 -- | 'nonEmpty' efficiently turns a normal list into a 'NonEmpty' stream,
 -- producing 'Nothing' if the input is empty.
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index f2ea265..97fdefd 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -84,6 +84,9 @@
   * `mkTyCon3` is no longer exported by `Data.Typeable`. This function is
     replaced by `Type.Reflection.Unsafe.mkTyCon`.
 
+  * `Data.List.NonEmpty.unfold` has been deprecated in favor of `unfoldr`,
+    which is functionally equivalent.
+
 ## 4.9.0.0  *May 2016*
 
   * Bundled with GHC 8.0



More information about the ghc-commits mailing list