Sum package:numhask

A wrapper for an Additive which distinguishes the additive structure
Compute the sum of a Foldable.
>>> sum [0..10]
55
Compute the accumulating sum of a Traversable.
>>> accsum [0..10]
[0,1,3,6,10,15,21,28,36,45,55]
The sum of a collection of actions using (<|>), generalizing concat. asum is just like msum, but generalised to Alternative.

Examples

Basic usage:
>>> asum [Just "Hello", Nothing, Just "World"]
Just "Hello"
The sum of a collection of actions using (<|>), generalizing concat. msum is just like asum, but specialised to MonadPlus.

Examples

Basic usage, using the MonadPlus instance for Maybe:
>>> msum [Just "Hello", Nothing, Just "World"]
Just "Hello"