-
Notifications
You must be signed in to change notification settings - Fork 162
Re-arrange Era
instances
#5207
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
Re-arrange Era
instances
#5207
Conversation
2caec03
to
5d41e3d
Compare
5145894
to
059cd2c
Compare
059cd2c
to
cd1e383
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit the relationship between the new EraHasName
and Era
is over my head.
But the result is great - and also find it useful that all Era
definitions are now in the same place - i seem to be looking at these definitions - small as they are- quite often, its good that they're much easier to find.
Looks good to me
libs/cardano-ledger-core/internal/Cardano/Ledger/Internal/Definition/Era.hs
Outdated
Show resolved
Hide resolved
libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Examples.hs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have questions 😅 . Looks great!
libs/cardano-ledger-core/internal/Cardano/Ledger/Internal/Definition/Era.hs
Outdated
Show resolved
Hide resolved
libs/cardano-ledger-core/internal/Cardano/Ledger/Internal/Definition/Era.hs
Show resolved
Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances/PParams.hs
Show resolved
Hide resolved
98159fb
to
dfa8ace
Compare
Description
This PR moves all
Era
type class instances into theinternal
sublibrary ofcardano-ledger-core
, which ii believe is an improvement in its own right, since we can now see all eras and their expected protocol versions in one place. However, the bigger reason why this change is introduced is to improve how we define constraints for functionality that should be available up to or starting from a specific era. This is achieved by introduction of a type level name for each era, that can safely be used to infer protocol version, without exposing access to the actual era types too early in the hierarchy.Checklist
CHANGELOG.md
files updated for packages with externally visible changes.NOTE: New section is never added with the code changes. (See RELEASING.md).
.cabal
andCHANGELOG.md
files when necessary, according to theversioning process.
.cabal
files updated when necessary.NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
scripts/fourmolize.sh
).scripts/cabal-format.sh
).scripts/gen-cddl.sh
)hie.yaml
updated (usescripts/gen-hie.sh
).