scalus.uplc.builtin.BuiltinList
See theBuiltinList companion object
A builtin list type corresponding to the Plutus Core builtin list.
This is the Scalus equivalent of BuiltinList in Plutus. It represents an immutable singly-linked list that can be used in Plutus smart contracts.
The list supports basic operations: checking emptiness, accessing head/tail, and prepending elements. These operations correspond directly to Plutus Core builtin functions.
==UPLC Builtin Operations==
The following UPLC builtins operate on lists:
mkCons- Prepend element (corresponds to::)headList- Get first element (corresponds tohead)tailList- Get all but first (corresponds totail)nullList- Check if empty (corresponds toisEmpty)chooseList- Pattern match on empty vs non-emptydropList- Drop first n elements (Plutus V4+)mkNilData- Create empty list of DatamkNilPairData- Create empty list of Data pairs
Type parameters
- A
-
the element type
Attributes
- See also
-
scalus.cardano.onchain.plutus.prelude.List for higher-level list operations
- Since
-
Plutus V1
- Note
-
For higher-level list operations like
map,filter,fold, etc., use scalus.cardano.onchain.plutus.prelude.List which provides a rich set of combinators. - Companion
- object
- Graph
-
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
In this article