[ add ] Pointwise lifting of algebra to Data.Vec.Functional - #3077
[ add ] Pointwise lifting of algebra to Data.Vec.Functional#3077JacquesCarette wants to merge 3 commits into
Data.Vec.Functional#3077Conversation
|
Is |
jamesmckinna
left a comment
There was a problem hiding this comment.
DRY!!!
The substance of this PR lies in answering the following question: what cannot be achieved by re-export from Algebra.Construct.Pointwise?
| Monoid; CommutativeMonoid; Group; AbelianGroup; NearSemiring; SemiringWithoutOne; | ||
| CommutativeSemiringWithoutOne; Semiring; CommutativeSemiring; IdempotentSemiring; | ||
| KleeneAlgebra; Quasiring; Ring; CommutativeRing) | ||
| import Algebra.Construct.Pointwise as Lift |
There was a problem hiding this comment.
Notwithstanding my use of lift for helper functions in Algebra.Construct.Pointwise, I personally hate the use of Lift as a module name for qualified import. I would much prefer
| import Algebra.Construct.Pointwise as Lift | |
| import Algebra.Construct.Pointwise as Pointwise |
cf. #2280
|
|
||
| {-# OPTIONS --without-K --safe #-} | ||
|
|
||
| module Data.Vec.Functional.Algebra.Base where |
There was a problem hiding this comment.
If the sole contents of this module are to be the re-exports of the Bundles, then this could be almost entirely shortcircuited (Fairbairn?) as:
| module Data.Vec.Functional.Algebra.Base where | |
| open import Data.Nat.Base using (ℕ) | |
| module Data.Vec.Functional.Algebra.Base (n : ℕ) where | |
| open import Data.Fin.Base using (Fin) | |
| -- Re-export existing constructions | |
| open import Algebra.Construct.Pointwise (Fin n) public |
And indeed, if there is to be more here, then why not refactor in this style anyway? (in the anonymous module you define below).
I think this was the substance of my critique of #2817 , and my suggestions that the corresponding Module additions be moved to Algebra.Module.Construct.Pointwise #2915 , and, if necessary, be re-exported here on the same basis as above?
|
Thanks for pointing out that this should morally be a 1-liner! And in that guise, if additions are made to the The question as to whether this is going to be all there is: it depends on whether the I don't think we should ever instantiate a "construction" module inside of itself. So if this module ends up a 1-liner in the end, I'm fine with that. |
I await developments! As for
I could imagine a similar 'staging':
Sounds principled! |
This is a partial redo of #2817 for all the
Algebraparts. If this seems good, then we can do theModuleparts as well.