IntersectMBO / IntersectMBO/cardano-ledger
Generic derivation of `Extract` instances
- Dominant language
- Haskell
- Stars
- 295
- Forks
- 179
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 29
Description
The `Extract` class appears to be used to get a value of a given type from `ModelNewEpochState`, similarly to how `uniplate` does it. We could implement a generic way to derive instances of `Extract`. It could traverse the data structure and look for a value of the given type. If there's more than one such value, it should fail somehow so we don't shoot ourselves into the foot.
Contributor guide
Research direction
Start by reading the existing Extract class and ModelNewEpochState usage, then compare the proposed traversal with how uniplate handles generic data access. The work is complete when Extract instances can be derived generically and the behavior for multiple matching values is explicitly defined and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100