[commit: ghc] master: Revert "Add strict variant of iterate" (1cdceb9)

git at git.haskell.org git at git.haskell.org
Sat Aug 19 11:45:06 UTC 2017


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

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

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

commit 1cdceb9fa3bc3ad01b2d840caad8e735513e14ed
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sat Aug 19 07:44:13 2017 -0400

    Revert "Add strict variant of iterate"
    
    This was not ready to commit.
    This reverts commit 8e5b6ec6566da57d15b0810a07902d9eac85cb79.


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

1cdceb9fa3bc3ad01b2d840caad8e735513e14ed
 libraries/base/Data/List.hs    |  1 -
 libraries/base/Data/OldList.hs |  1 -
 libraries/base/GHC/List.hs     | 25 +------------------------
 libraries/base/changelog.md    |  3 ---
 4 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/libraries/base/Data/List.hs b/libraries/base/Data/List.hs
index 2ac04a9..693c0dd 100644
--- a/libraries/base/Data/List.hs
+++ b/libraries/base/Data/List.hs
@@ -76,7 +76,6 @@ module Data.List
 
    -- ** Infinite lists
    , iterate
-   , iterate'
    , repeat
    , replicate
    , cycle
diff --git a/libraries/base/Data/OldList.hs b/libraries/base/Data/OldList.hs
index c4c38d4..d03c0bc 100644
--- a/libraries/base/Data/OldList.hs
+++ b/libraries/base/Data/OldList.hs
@@ -77,7 +77,6 @@ module Data.OldList
 
    -- ** Infinite lists
    , iterate
-   , iterate'
    , repeat
    , replicate
    , cycle
diff --git a/libraries/base/GHC/List.hs b/libraries/base/GHC/List.hs
index ca95379..70bfbe4 100644
--- a/libraries/base/GHC/List.hs
+++ b/libraries/base/GHC/List.hs
@@ -23,7 +23,7 @@ module GHC.List (
    map, (++), filter, concat,
    head, last, tail, init, uncons, null, length, (!!),
    foldl, foldl', foldl1, foldl1', scanl, scanl1, scanl', foldr, foldr1,
-   scanr, scanr1, iterate, iterate', repeat, replicate, cycle,
+   scanr, scanr1, iterate, repeat, replicate, cycle,
    take, drop, sum, product, maximum, minimum, splitAt, takeWhile, dropWhile,
    span, break, reverse, and, or,
    any, all, elem, notElem, lookup,
@@ -458,29 +458,6 @@ iterateFB c f x0 = go x0
  #-}
 
 
--- | 'iterate\'' is the strict version of 'iterate'.
---
--- It ensures that the result of each application of force to weak head normal
--- form before proceeding.
-{-# NOINLINE [1] iterate' #-}
-iterate' :: (a -> a) -> a -> [a]
-iterate' f x =
-    let x' = f x
-    in x' `seq` (x : iterate' f x')
-
-{-# INLINE [0] iterate'FB #-} -- See Note [Inline FB functions]
-iterate'FB :: (a -> b -> b) -> (a -> a) -> a -> b
-iterate'FB c f x0 = go x0
-  where go x =
-            let x' = f x
-            in x' `seq` (x `c` go x')
-
-{-# RULES
-"iterate'"    [~1] forall f x.   iterate' f x = build (\c _n -> iterate'FB c f x)
-"iterate'FB"  [1]                iterate'FB (:) = iterate'
- #-}
-
-
 -- | 'repeat' @x@ is an infinite list, with @x@ the value of every element.
 repeat :: a -> [a]
 {-# INLINE [0] repeat #-}
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index a62b8339..ab304a3 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -16,9 +16,6 @@
 
   * Add instances `Semigroup` and `Monoid` for `Control.Monad.ST` (#14107).
 
-  * Add `iterate'`, a strict version of `iterate`, to `Data.List`
-    and `Data.OldList` (#3474)
-
 ## 4.10.0.0 *April 2017*
   * Bundled with GHC *TBA*
 



More information about the ghc-commits mailing list