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

Add a general mkPair #6592

Open
effectfully opened this issue Oct 22, 2024 · 0 comments
Open

Add a general mkPair #6592

effectfully opened this issue Oct 22, 2024 · 0 comments
Labels
Builtins Low priority Doesn't require immediate attention status: triaged

Comments

@effectfully
Copy link
Contributor

It is currently not possible to construct pairs of values of arbitrary built-in types, only (Data, Data). This means that a lot of things that could be represented as pairs, list of pairs, list of pairs of lists etc currently have to go through either Data or SOPs. In particular, Value is a map from CurrencySymbol to a map from TokenName to Integer, i.e. could be represented as [(ByteString, [(ByteString, Integer)])].

So given that both the specification and the formalization support mkPair in principle, we should perhaps allow it in the implementation as well (see this on why we can't add mkPair right away). The way to support it is to introduce the # kind like the specification and the formalization do. I'm not really sure how that is supposed to be reflected in Plinth though.

But on the other hand... why not just use SOPs? I guess, because certain toolchains like Aiken don't bother themselves with SOPs? Maybe we want to respect that, maybe they should add some support for SOPs, dunno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builtins Low priority Doesn't require immediate attention status: triaged
Projects
None yet
Development

No branches or pull requests

1 participant