[GHC] #15521: Provide a strict version of sum

GHC ghc-devs at haskell.org
Tue Aug 14 19:56:10 UTC 2018


#15521: Provide a strict version of sum
-------------------------------------+-------------------------------------
           Reporter:  dnadales       |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Prelude        |           Version:  8.4.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 When adding huge list of numbers, a strict version of `sum` is preferred
 to avoid an unnecessary use of memory. A strict version of `sum` can be
 easily written using `foldl'` but it'd be nicer if a function such as:

 {{{#!hs
 sum' = foldl' (+) 0
 }}}

 would be provided in the prelude already.

 Does this makes sense?

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


More information about the ghc-tickets mailing list