-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ refactor ] Remove sum
and product
(and their properties) from Data.List.*
#2553
Comments
sum
and product
(and their properties) from Data.Nat.*
sum
and product
(and their properties) from Data.List.*
It is not natural for Data.List to use the function of product of a list of natural numbers, and for Data.List.Properties to |
I emphatically agree with removing |
In my proposal with IntegralSemiring, |
This is a long-standing legacy issue that causes problems esp. regarding:
Data.List.Base
andProperties
need to importData.Nat.Divisibility
otherwise unnecessarily; also, how much ofAlgebra
should be imported by 'concrete'Data
modules?Data.List.Properties
ends up being where properties ofsum
andproduct
get proved...(Raw)Monoid
s, and should be treated as suchData.List.Relation.Binary.Permutation.*
intoData.List.Properties
, etc.?)Just as, in the end, it was (judged to be) 'better' to lift out
scan
s fromData.List.Base
,sum
andproduct
should be lifted out fromData.List.Base
(and correspondingly their properties fromData.List.Properties
) into (at least!) a separate module.Lots of design choices here:
Algebra.Definitions.RawMonoid
/Algebra.Properties.Monoid
? Deprecation problems wrt the existing definitions and properties ofsum
etc. so potentially lots ofbreaking
changes, otherwise a mess of deprecations?Algebra.Properties.(Commutative)(Semi)Ring
etc.Nat
(and the other numeric typesInteger
andRational
?): what should the module be called?List
, or abstractFreeMonoid
? (the latter seems preferable, as an algebraic definition; the former for computation... usual issues/trade-offs arise cf. The design of 'free objects' #2539 etc.) This might (usefully!) uncouple the dependency currently onData.Vec.Functional
forsum
etc.Possible implementation pathway (UPDATED):
Data.Nat.ListAction
#2558 and [ refactor ] AddData.Bool.ListAction
#2561UPDATED: I got the locations wrong! But in many ways, having these
Nat
operations underList
is even less appropriate!?The text was updated successfully, but these errors were encountered: