Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PlutusData typeclass implementation should be unconditionally printed during TyDef

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell
Domain
compilers

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

bug codegen plutarch

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mlabs-haskell/lambda-buffers

All issues in mlabs-haskell/lambda-buffers

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.