- 
                Notifications
    You must be signed in to change notification settings 
- Fork 259
Closed
Labels
status: duplicateThe main contents of the issue or PR already exists in another issue or PR.The main contents of the issue or PR already exists in another issue or PR.
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.
?
Metadata
Metadata
Assignees
Labels
status: duplicateThe main contents of the issue or PR already exists in another issue or PR.The main contents of the issue or PR already exists in another issue or PR.