[GHC] #3474: Add a strict variant of iterate to Data.List

GHC ghc-devs at haskell.org
Wed Aug 16 12:52:30 UTC 2017


#3474: Add a strict variant of iterate to Data.List
-------------------------------------+-------------------------------------
        Reporter:  mux               |                Owner:  (none)
            Type:  proposal          |               Status:  new
        Priority:  normal            |            Milestone:  8.2.2
       Component:  libraries/base    |              Version:  6.10.4
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by winter):

 I suppose a modification from `fold'` 's document is OK:


 -- | The strict version of 'iterate'.

 -- It ensures that each step of the iterating is forced to weak head
 normal form before next step, avoiding the collection of thunks that would
 otherwise occur. This is often what you want to strictly step a function
 which produces a single, monolithic result (e.g. (+1)).

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/3474#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list