IntersectMBO / IntersectMBO/cardano-ledger

Generic derivation of `Extract` instances

Open
#3,233 0 comments 0 reactions 0 assignees View on GitHub
:credit_card: technical-debt
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.