LeanColls
LeanColls copied to clipboard
`reduce` and family
Add reduce? : C -> (t -> t) -> Option t with default implementation for any Foldable collection
Can also then implement generic sum, prod, max, min based on it
If we generalize #5 to cover nonempty collections, then we may also want reduce : C -> (t -> t) -> t. I'm imagining it could also be implemented generically for any Fold and NonemptyColl by doing reduce? followed by getD with the default value from the collection.