scalus.cardano.onchain.plutus.prelude.PairList
See thePairList companion object
A list of key-value pairs that stays in the UPLC BuiltinPair representation, avoiding costly per-element conversions between PairData and ConstrData that occur when using List[(A, B)] with generic map/filter.
On JVM, PairList behaves like a regular list of tuples. On-chain, the compiler lowers it to the same SumDataPairList representation as List[(A, B)], so conversions via toList / toPairList are zero-cost (no UPLC code generated).
Pair-specific operations like mapValues operate directly on fstPair/sndPair builtins, yielding ~3x fewer builtin operations per element compared to List.map on tuples.
Type parameters
- A
-
the type of the first element (key)
- B
-
the type of the second element (value)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
- Known subtypes
-
Members list
In this article