Sum package:universum

Monoid under addition.
Sum a <> Sum b = Sum (a + b)

Examples

>>> Sum 1 <> Sum 2 <> mempty
Sum {getSum = 3}
>>> mconcat [ Sum n | n <- [3 .. 9]]
Sum {getSum = 42}
Stricter version of sum.
>>> sum [1..10]
55

>>> sum (Just 3)
...
• Do not use 'Foldable' methods on Maybe
Suggestions:
Instead of
for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
use
whenJust  :: Applicative f => Maybe a    -> (a -> f ()) -> f ()
whenRight :: Applicative f => Either l r -> (r -> f ()) -> f ()
...
Instead of
fold :: (Foldable t, Monoid m) => t m -> m
use
maybeToMonoid :: Monoid m => Maybe m -> m
...
Custom prelude used in Serokell See README.md file for more details.
Main module that reexports all functionality allowed to use without importing any other modules. Just add next lines to your module to replace default Prelude with better one.
{-# LANGUAGE NoImplicitPrelude #-}

import Universum
This documentation section contains description of internal module structure to help navigate between modules, search for interesting functionalities and understand where you need to put your new changes. Functions and types are distributed across multiple modules and grouped by meaning or theme. Name of the module should give you hints regarding what this module contains. Some themes contain a great amount of both reexported functions and functions of our own. To make it easier to understand these huge chunks of functions, all reexported stuff is moved into separate module with name Universum.SomeTheme.Reexport and our own functions and types are in Universum.SomeTheme.SomeName. For example, see modules Universum.Container.Class and Universum.Container.Reexport. Below is a short description of what you can find under different modules:
Constrained to Container version of asum.
>>> asum [Nothing, Just [False, True], Nothing, Just [True]]
Just [False,True]