mlabs-haskell / mlabs-haskell/lambda-buffers

Discuss: PlutusData meaning for Prelude types

Open
#228 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
32
Forks
1
PR merge metrics
No merged PRs in 30d

Description

What is PlutusData (toData and fromData) meaning for all Prelude types?

https://github.com/mlabs-haskell/lambda-buffers/blob/26adebd13cb97900cec7fe66cb1dd11977ba77ed/libs/lbf-plutus/Plutus/V1.lbf#L15

-- Instances for Prelude types
-- TODO(bladyjoker): Add other Prelude types (Text, Bytes etc.)?
instance PlutusData Bool
instance PlutusData Integer
instance PlutusData (Maybe a) :- PlutusData a
instance PlutusData (List a) :- PlutusData a
instance PlutusData (Either a b) :- PlutusData a, PlutusData b

These are obvious, but we could theoretically define PlutusData for Prelude Char/Text/Bytes/Map/Set.

Gergely's Rust backend already implements some notion of PlutusData for these types.

Should we complete this?

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.

Research direction

Start by reading the Prelude type instances in libs/lbf-plutus/Plutus/V1.lbf and comparing them with the existing Rust backend implementations mentioned in the issue. The work is complete when the supported Prelude types and their PlutusData toData/fromData semantics are decided and the relevant implementations are aligned.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, rust
Domain
backend, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.