plutus-core
Safe HaskellNone
LanguageHaskell2010

PlutusCore.Arrays

Description

Implementation for the array builtins of CIP-0156 that needs more than a one-liner.

Synopsis

Documentation

multiIndexArray :: Vector a -> [Integer] -> BuiltinResult [a] Source #

Look up every index of the given list in the given array.

Fails if any index is out of bounds, or if there are more than maximumIndexCount of them; see Note [Index count limitation for multiIndexArray].

The elements are read eagerly, as in indexArray, so that the read is paid for inside this builtin rather than wherever the element is later demanded. Forcing is safe: the vector is strict, so the element is already in normal form as far as this function is concerned.