-
Notifications
You must be signed in to change notification settings - Fork 259
Open
Milestone
Description
This is a long-standing legacy issue (cf. #1099 ) that causes problems esp. regarding:
- the dependency graph:
Data.List.BaseandPropertiesneed to importData.Nat.Divisibilityotherwise unnecessarily; also, how much ofAlgebrashould be imported by 'concrete'Datamodules?Data.List.Propertiesends up being where properties ofsumandproductget proved... - abstraction level: these are operations definable on
(Raw)Monoids, and should be treated as such - extensibility: every time a 'new' property needs to be proven, the above questions need to be re-examined (esp. wrt dependency, eg do we want to import
Data.List.Relation.Binary.Permutation.*intoData.List.Properties, etc.?) - etc.
Just as, in the end, it was (judged to be) 'better' to lift out scans from Data.List.Base, sum and product should be lifted out from Data.List.Base (and correspondingly their properties from Data.List.Properties) into (at least!) a separate module.
Lots of design choices here:
- a general theory under
Algebra.Definitions.RawMonoid/Algebra.Properties.Monoid? Deprecation problems wrt the existing definitions and properties ofsumetc. so potentially lots ofbreakingchanges, otherwise a mess of deprecations? - theory of interaction(s) between them (esp. wrt distributivity) under
Algebra.Properties.(Commutative)(Semi)Ringetc. - instantiation for
Nat(and the other numeric typesIntegerandRational?): what should the module be called? - definition in terms of concrete
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.Functionalforsumetc.
Possible implementation pathway (UPDATED):
- v2.3, a 'minimal', move+deprecation-only refactoring: [ refactor ] Add
Data.Nat.ListAction#2558 and [ refactor ] AddData.Bool.ListAction#2561 - v3.0, a breaking version to get things 'right' (we need to agree what this means!)
UPDATED: I got the locations wrong! But in many ways, having these Nat operations under List is even less appropriate!?
JacquesCarette