[Haskell-cafe] curious about sum
Conal Elliott
conal at conal.net
Sat Jun 13 13:23:45 EDT 2009
You can make numeric class instances from arbitrary Applicatives [1]. 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.
[1]
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/applicative-numbers
- Conal
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
>
> -Keith
> --
> keithsheppard.name
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090613/f4f45d07/attachment.html
More information about the Haskell-Cafe
mailing list