[Haskell-cafe] Is there a library that has a strict version of `sum`?

Brandon Allbery allbery.b at gmail.com
Tue Aug 14 19:25:26 UTC 2018


On Tue, Aug 14, 2018 at 2:57 PM Damian Nadales <damian.nadales at gmail.com>
wrote:

> In view of this, I though, "I can write this replacing `sum` by `foldl'
> (+) 0` but wouldn't be nice if this function was defined already somewhere
> else?" That's it.
>

There's a certain tendency for people to look for even trivial canned
solutions, which to my mind misses the point of functional programming.
It's trivial to build exactly what you need from the building blocks you
have, so canned solutions like Prelude "sum" lead both to this kind of
problem when they don't quite fit, and at the same time inappropriately
encourage people to go looking for "more appropriate" canned solutions.

-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180814/b44a735a/attachment.html>


More information about the Haskell-Cafe mailing list