summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-04-04 21:48:49 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-04 21:48:50 -0400
commitce9b6170b0ac9ff417000d8e7bdff7b2298f2978 (patch)
treee3d58c1d3150555fafb9d1ffa86e4dd380c4a0ee /libraries/base
parent486b8db05fefd1cfa916928c74958f8099b9f9f8 (diff)
downloadhaskell-ce9b6170b0ac9ff417000d8e7bdff7b2298f2978.tar.gz
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
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/Data/List/NonEmpty.hs2
-rw-r--r--libraries/base/changelog.md3
2 files changed, 5 insertions, 0 deletions
diff --git a/libraries/base/Data/List/NonEmpty.hs b/libraries/base/Data/List/NonEmpty.hs
index 2f9f868b43..9a9de018dd 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 854a9b81ed..e2e276a4c9 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