Closed
Description
Data.List.Base has sum
and product
for lists over Nat.
Probably it is better to replace this with a generic design:
module Algebra.Properties.Monoid ... where
C = Carrier
Π₁ : C → List C → C -- product of a nonempty list of elements
Π₁ x = foldr _∙_ x
Π : List C → C -- product of a list of elements
Π = Π₁ ε
----------------------------------------
module Algebra.Properties.Semiring ... where
...
sum1 : C → List C → C
sum1 = Algebra.Properties.Monoid.Π₁ +-0-monoid
sum : List C → C
sum = Algebra.Properties.Monoid.Π +-0-monoid
with adding to Algebra.Properties the needed modules for Monoid and Semiring.
?