[commit: ghc] master: base: Mark unfold as deprecated (ce9b617)

git at git.haskell.org git at git.haskell.org
Wed Apr 5 02:23:22 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ce9b6170b0ac9ff417000d8e7bdff7b2298f2978/ghc

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

commit ce9b6170b0ac9ff417000d8e7bdff7b2298f2978
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


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

ce9b6170b0ac9ff417000d8e7bdff7b2298f2978
 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 854a9b8..e2e276a 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -89,6 +89,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