[Haskell-cafe] curious about sum
conal at conal.net
Sat Jun 13 13:23:45 EDT 2009
You can make numeric class instances from arbitrary Applicatives . I
imagine a lot of them (e.g. Stream) would want at least some
non-strictness. We might provide strict alternatives for sum and product.
I wonder what else.
On Sat, Jun 13, 2009 at 7:03 AM, Keith Sheppard <keithshep at gmail.com> wrote:
> Is there any reason that sum isn't strict? I can't think of any case
> where that is a good thing.
> Prelude> sum [0 .. 1000000]
> *** Exception: stack overflow
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe