IntersectMBO / IntersectMBO/plutus

Add a general `mkPair`

Open
#6,592 4 comments 0 reactions 0 assignees View on GitHub
Builtins Low priority status: triaged
Dominant language
Haskell
Stars
1.6k
Forks
508
Avg merge
3d 10h
Merged PRs (30d)
22

Description

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](https://github.com/IntersectMBO/plutus/blob/cfd420c4f40d379334cb8dfd20b7b5248ad2b9c7/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs#L1007-L1086) 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.