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

Discuss: PlutusData meaning for Prelude types #228

Open
bladyjoker opened this issue Jun 13, 2024 · 1 comment
Open

Discuss: PlutusData meaning for Prelude types #228

bladyjoker opened this issue Jun 13, 2024 · 1 comment

Comments

@bladyjoker
Copy link
Contributor

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

-- Instances for Prelude types

-- 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?

@bladyjoker
Copy link
Contributor Author

Options:

Remove Plutus Map and Bytes

Do we need them. For offchain backends like Rust, it doesn't really matter, so we could remove these and just define PlutusData semantics for Prelude Map and Bytes.

For onchain, Plutarch and PlutusTx, I think the same could apply. The codegen configs are separate and they can map Prelude types to equivalent Plutus types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant