GaloisInc / GaloisInc/parameterized-utils

`Data.Parameterized.TH.GADT`: Offer a helper for automating `EqF` instances

Open
#175 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.