Skip to content

[ add ] Data.List.Base.foldMap and refactor#3026

Open
jamesmckinna wants to merge 14 commits into
agda:masterfrom
jamesmckinna:issue2553-bis
Open

[ add ] Data.List.Base.foldMap and refactor#3026
jamesmckinna wants to merge 14 commits into
agda:masterfrom
jamesmckinna:issue2553-bis

Conversation

@jamesmckinna

@jamesmckinna jamesmckinna commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Fix the remaining (second and third) items in #3016 in line with my most recent comment on #2553

DONE:

  • fix up metavariables so that foldMap-congruent typechecks
  • fix up definitions so that foldr-congruent become an instance of foldMap-congruent

NB. does not yet refactor/redefine definitions in Data.Bool.ListAction etc. for the time being!

@jamesmckinna jamesmckinna added this to the v3.0 milestone Jun 20, 2026
Comment thread src/Data/List/Effectful/Foldable.agda Outdated
Comment thread src/Data/List/Effectful/Foldable.agda Outdated
@jamesmckinna

jamesmckinna commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @JacquesCarette for continuing to comment on a DRAFT.
I think that this ready for review, although the Foldable proofs are definitely a lot gnarlier than I might have hoped, esp. wrt rewrite steps, but I just can't face doing more work on them now. Suggest that they be improved in a downstream PR, once it's (perhaps) a bit clearer how best to proceed.

Everything typechecks, but I have the feeling that the new definitions and properties are all still at present ... suboptimal. Certainly when trying to apply them to the intended refactorings of Data.Bool.ListAction etc. Sigh.

@jamesmckinna jamesmckinna marked this pull request as ready for review June 22, 2026 16:30
@jamesmckinna

Copy link
Copy Markdown
Collaborator Author

Everything typechecks, but I just have the feeling that the new definitions and properties are all still at present suboptimal... so maybe let this one lie for a bit before pursuing further?

@jamesmckinna

Copy link
Copy Markdown
Collaborator Author

I've taken #3016 off the docket as being fixed by this PR, because there's currently no refactoring to allow eg and-++ simply to be derived as an instance of the foldMap homomorphism theorem etc.... TODO!

@JacquesCarette JacquesCarette left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I would want to have all those proofs be properly equational. And some of the new reasoning combinators can be used to shorten some of the proofs you do have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ refactor ] move Data.List.Relation.Binary.Permutation.Setoid.Properties.foldr-commMonoid to Data.List.Effectful.Foldable?

2 participants