
#15521: Provide a strict version of sum -------------------------------------+------------------------------------- Reporter: dnadales | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Prelude | Version: 8.4.3 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 f-a): Thanks ulysses4ever Replying to [comment:2 ulysses4ever]:
Also, Haskell Report (the Haskell standard) says that `sum` should behave lazily (AFAIK). So, changing the behavior of `sum` seems a bit of extreme to me. I'd rather argue for adding `sum' / product'` to `Prelude`.
I thought the same, but: {{{ -- from page 192 of the "Haskell 2010 Language Report" sum :: Num a => [a] -> a The sum function computes the sum of a finite list of numbers. }}} Is mandatory laziness stated somewhere else? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15521#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler