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

Make ToBuiltin handle any kind of built-in list #5924

Closed
effectfully opened this issue Apr 24, 2024 · 2 comments
Closed

Make ToBuiltin handle any kind of built-in list #5924

effectfully opened this issue Apr 24, 2024 · 2 comments

Comments

@effectfully
Copy link
Contributor

PlutusTx.Builtins.Class has the following:

instance ToBuiltin [BuiltinData] (BuiltinList BuiltinData) where
    {-# INLINABLE toBuiltin #-}
    toBuiltin []     = mkNilData unitval
    toBuiltin (d:ds) = mkCons d (toBuiltin ds)

instance ToBuiltin [(BuiltinData, BuiltinData)] (BuiltinList (BuiltinPair BuiltinData BuiltinData)) where
    {-# INLINABLE toBuiltin #-}
    toBuiltin []     = mkNilPairData unitval
    toBuiltin (d:ds) = mkCons (toBuiltin d) (toBuiltin ds)

We should be able to handle any kind of built-in list, since we don't really need those mkNilData and mkNilPairData builtins as we can simply embed the empty list constants directly.

@effectfully
Copy link
Contributor Author

ToBuiltin is now called ToOpaque.

@effectfully
Copy link
Contributor Author

Was fixed by #6347.

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

No branches or pull requests

1 participant