| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusCore.Arrays
Description
Implementation for the array builtins of CIP-0156 that needs more than a one-liner.
Synopsis
- multiIndexArray ∷ ∀ a. Vector a → [Integer] → BuiltinResult [a]
- maximumIndexCount ∷ Int
Documentation
multiIndexArray ∷ ∀ a. 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.