Skip to content
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

Classes defined in each era should go into Core module #2932

Closed
lehins opened this issue Jul 26, 2022 · 1 comment · Fixed by #3036
Closed

Classes defined in each era should go into Core module #2932

lehins opened this issue Jul 26, 2022 · 1 comment · Fixed by #3036
Assignees
Labels
💳 technical-debt Issues related to technical debt we introduced

Comments

@lehins
Copy link
Collaborator

lehins commented Jul 26, 2022

It was discussed that classes are spread around through out the repo and it would be best if each era defined type classes in the Cardano.Ledger.[Era].Core module. Unless of course the type class is used as an internal implementation in some module.

For example newly defined type classes in #2901, eg AlonzoEraTxBody is defined in Cardano.Ledger.Alonzo.TxBody module, but it needs to move into Cardano.Ledger.Alonzo.Core, while instances should still live in Cardano.Ledger.Alonzo.TxBody.

For convenience I also suggest we re-export the whole of Cardno.Ledger.Core module and Cardano.Ledger.[Era].Core from a previous era from it as well. Eg.

module Cardano.Ledger.Shelley.Core
  ( module Cardano.Ledger.Core
  , ShelleyTxBody(..)
  ...
  ) where
module Cardano.Ledger.ShelleyMA.Core
  ( module Cardano.Ledger.Shelley.Core
  , ShelleyMATxBody(..)
  ...
  ) where
@lehins lehins added the 💳 technical-debt Issues related to technical debt we introduced label Jul 26, 2022
@lehins
Copy link
Collaborator Author

lehins commented Jul 26, 2022

CC @TimSheard this was your idea, so just letting you know that I created this ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💳 technical-debt Issues related to technical debt we introduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants