Skip to content

Fix COMPLETE for all type class based pattern synonyms #4613

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

Open
2 tasks done
lehins opened this issue Sep 9, 2024 · 3 comments · May be fixed by #5099
Open
2 tasks done

Fix COMPLETE for all type class based pattern synonyms #4613

lehins opened this issue Sep 9, 2024 · 3 comments · May be fixed by #5099
Assignees
Labels
💳 technical-debt Issues related to technical debt we introduced

Comments

@lehins
Copy link
Collaborator

lehins commented Sep 9, 2024

We have a few type class based pattern synonyms:

  • - TxCerts
  • - NativeScripts

All of these cannot have a COMPLETE pragma implemented for them, since ghc-8.10 does not support new syntax with the type. For example that is why we had to reject this RP: https://github.com/IntersectMBO/cardano-ledger/pull/4481/files

Which tried to add an incorrect pattern:

{-# COMPLETE
  RequireSignature
  , RequireAllOf
  , RequireAnyOf
  , RequireMOf
  #-}

since it would disregard timelock's RequireTimeStart and RequireTimeExpire.

Therefore, the correct way to solve this is to specify COMPELTE pragma for each era:

{-# COMPLETE
  RequireSignature
  , RequireAllOf
  , RequireAnyOf
  , RequireMOf :: Shelley
  #-}
{-# COMPLETE
  RequireSignature
  , RequireAllOf
  , RequireAnyOf
  , RequireMOf
  , RequireTimeStart
  , RequireTimeExpire :: Allegra
  #-}

etc.

@lehins
Copy link
Collaborator Author

lehins commented Sep 9, 2024

This could be done before we deprecate usage of GHC-8.10 with some CPP

@lehins lehins added the 💳 technical-debt Issues related to technical debt we introduced label Sep 9, 2024
@aniketd aniketd self-assigned this May 9, 2025
@aniketd
Copy link
Contributor

aniketd commented May 19, 2025

Relevant clarification about the currently possible solution: #5053

@lehins
Copy link
Collaborator Author

lehins commented May 21, 2025

Looks like the only way to solve this ticket is by moving all definitions of era types into separate internal sublibrary in cardano-ledger-core. Here is a task that will unblock this issue when resolved: #5069

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.

3 participants