GaloisInc / GaloisInc/parameterized-utils
`Data.Parameterized.TH.GADT`: Offer a helper for automating `EqF` instances
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 59
- Forks
- 14
- Avg merge
- 45m
- Merged PRs (30d)
- 1
Description
Data.Parameterized.TH.GADT currently offers structuralTypeEquality, which automates the generation of TestEquality instances, but it does not yet offer a counterpart for generating EqF instances. The closest thing that currently exists is structuralEquality, but this is unsuitable for EqF instances in general because it is implemented as isJust (... testEquality ...) under the hood. This means that you can end up with instances that look like instance TestEquality f => EqF (T f), which uses a stronger instance context than what is necessary.
We should offer a variant of structuralEquality which generates code that gives rise to instance Eq f => EqF (T f) instead.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Data.Parameterized.TH.GADT and compare structuralEquality with structuralTypeEquality to understand their generated instances. Design the requested counterpart so it generates EqF instances from Eq constraints rather than TestEquality constraints, and verify that the resulting context is no stronger than necessary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100