Skip to content
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

Add instance Foldable1 for Field, FieldLine, SectionArg and Name #9351

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

Bodigrim
Copy link
Collaborator

I've been experimenting with things and it seems having instance Foldable1 would be helpful: it allows to express that any Field has at least one annotation and provides for ways to collect a non-empty list of all of them.

@Bodigrim
Copy link
Collaborator Author

Rebased and added since annotations.

@Bodigrim Bodigrim added the merge me Tell Mergify Bot to merge label Oct 21, 2023
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Oct 23, 2023
@mergify mergify bot merged commit c63eeb4 into master Oct 23, 2023
45 checks passed
@mergify mergify bot deleted the foldable1-for-fields branch October 23, 2023 13:11
@phadej
Copy link
Collaborator

phadej commented Oct 23, 2023

It would be great if Cabal-syntax (conditionally) depended on https://hackage.haskell.org/package/functor-classes-compat, and have Foldable1 instances for all base versions. Foldable1 is there in base for bootstrap GHCs (9.6 and 9.8), that wont add an extra boot dependency.

@andreabedini
Copy link
Collaborator

It would be great if Cabal-syntax (conditionally) depended on https://hackage.haskell.org/package/functor-classes-compat, and have Foldable1 instances for all base versions. Foldable1 is there in base for bootstrap GHCs (9.6 and 9.8), that wont add an extra boot dependency.

Let me repeat this in my own words. You are saying that we can affort (conditional) extra dependencies to support compiling with already released versions of GHC. In other words, Cabal and Cabal-syntax have to be able to compile with only the boot packages of the GHC version to come.

Call me stupid, I never thought of this.

@phadej
Copy link
Collaborator

phadej commented Oct 24, 2023

Yes, see e.g. https://hackage.haskell.org/package/Cabal-3.6.0.0/dependencies

Depends on semigroups for real Semigroup, tagged for Proxy and void for Void, which all since have been in base.

Now these compat dependencies have been dropped as base lower bound has been raised.

EDIT: ... in particular Cabal may itself start using Foldable1 stuff, if found fit, e.g. add Foldable1s head to its internal prelude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants