PlutusData typeclass implementation should be unconditionally printed during TyDef
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start with the lbf-plutus-to-plutarch path that handles TyDef and inspect how the example sum type is rendered. Compare its generated declarations with the manual derive PlutusData NftMarketplaceRedeemer workaround, then compile the generated output. Done means the needed PlutusData-related declaration is emitted before GHC reports the missing PlutusType instance.
Written by the indexing model from the issue text.
Description
@t4ccer
Alright, I have first maybe bug. If I have
sum NftMarketplaceRedeemer = Buy | Cancel
and run it through lbf-plutus-to-plutarch and try to compile, I'll get a GHC error saying
• No instance for (Plutarch.Prelude.PlutusType
NftMarketplaceRedeemer)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
• When deriving the instance for (Plutarch.Show.PShow
NftMarketplaceRedeemer)
|
40 | deriving anyclass Plutarch.Show.PShow
| ^^^^^^^^^^^^^^^^^^
Of course adding derive PlutusData NftMarketplaceRedeemer fixes the issue, but I have a feeling that it should be caught before going to ghc
- Dominant language
- Haskell
- Stars
- 32
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mlabs-haskell/lambda-buffers
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
mlabs-haskell/lambda-buffers#296 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
mlabs-haskell/lambda-buffers#295 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
mlabs-haskell/lambda-buffers#294 ·
-
Dykstra HF Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mlabs-haskell/lambda-buffers#293 ·
-
Nix-free path Opendevops
Difficulty 5/5 Over a week Newbie friendliness 25/100
mlabs-haskell/lambda-buffers#292 ·
All issues in mlabs-haskell/lambda-buffers
Similar issues
-
typst-0.12 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
commercialhaskell/stackage#8127 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
input-output-hk/haskell.nix#2573 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100