BuiltinList

scalus.uplc.builtin.BuiltinList
See theBuiltinList companion object
enum BuiltinList[+A]

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 to head)
  • tailList - Get all but first (corresponds to tail)
  • nullList - Check if empty (corresponds to isEmpty)
  • chooseList - Pattern match on empty vs non-empty
  • dropList - Drop first n elements (Plutus V4+)
  • mkNilData - Create empty list of Data
  • mkNilPairData - 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 Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
In this article