plutus-tx-1.36.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx.List

Synopsis

Documentation

uncons ∷ [a] → Maybe (a, [a]) Source #

Plutus Tx version of uncons.

null ∷ [a] → Bool Source #

Test whether a list is empty.

map ∷ ∀ a b. (a → b) → [a] → [b] Source #

Plutus Tx version of map.

>>> map (\i -> i + 1) [1, 2, 3]
[2,3,4]

and ∷ [Bool] → Bool Source #

Returns the conjunction of a list of Bools.

or ∷ [Bool] → Bool Source #

Returns the disjunction of a list of Bools.

any ∷ ∀ a. (a → Bool) → [a] → Bool Source #

Determines whether any element of the structure satisfies the predicate.

all ∷ ∀ a. (a → Bool) → [a] → Bool Source #

Determines whether all elements of the list satisfy the predicate.

elemEq a ⇒ a → [a] → Bool Source #

Does the element occur in the list?

notElemEq a ⇒ a → [a] → Bool Source #

The negation of elem.

find ∷ ∀ a. (a → Bool) → [a] → Maybe a Source #

Returns the leftmost element matching the predicate, or Nothing if there's no such element.

filter ∷ (a → Bool) → [a] → [a] Source #

Plutus Tx version of filter.

>>> filter (> 1) [1, 2, 3, 4]
[2,3,4]

listToMaybe ∷ [a] → Maybe a Source #

Plutus Tx version of listToMaybe.

uniqueElement ∷ [a] → Maybe a Source #

Return the element in the list, if there is precisely one.

findIndices ∷ (a → Bool) → [a] → [Integer] Source #

Plutus Tx version of findIndices.

findIndex ∷ (a → Bool) → [a] → Maybe Integer Source #

Plutus Tx version of findIndex.

foldr ∷ ∀ a b. (a → b → b) → b → [a] → b Source #

Plutus Tx version of foldr.

>>> foldr (\i s -> s + i) 0 [1, 2, 3, 4]
10

foldl ∷ ∀ a b. (b → a → b) → b → [a] → b Source #

Plutus Tx velsion of foldl.

>>> foldl (\s i -> s + i) 0 [1, 2, 3, 4]
10

revAppend ∷ ∀ a. [a] → [a] → [a] Source #

Cons each element of the first list to the second one in reverse order (i.e. the last element of the first list is the head of the result).

revAppend xs ys === reverse xs ++ ys
>>> revAppend "abc" "de"
"cbade"

reverse ∷ [a] → [a] Source #

Plutus Tx version of reverse.

concat ∷ [[a]] → [a] Source #

Plutus Tx version of concat.

>>> concat [[1, 2], [3], [4, 5]]
[1,2,3,4,5]

concatMap ∷ (a → [b]) → [a] → [b] Source #

Plutus Tx version of concatMap.

zip ∷ [a] → [b] → [(a, b)] Source #

Plutus Tx version of zip.

unzip ∷ [(a, b)] → ([a], [b]) Source #

Plutus Tx version of unzip.

(++) ∷ [a] → [a] → [a] infixr 5 Source #

Plutus Tx version of (++).

>>> [0, 1, 2] ++ [1, 2, 3, 4]
[0,1,2,1,2,3,4]

(!!) ∷ ∀ a. [a] → Integer → a infixl 9 Source #

Plutus Tx version of (!!).

>>> [10, 11, 12] !! 2
12

indexBuiltinList ∷ ∀ a. BuiltinList a → Integer → a Source #

Index operator for builtin lists.

>>> indexBuiltinList (toBuiltin [10, 11, 12]) 2
12

head ∷ [a] → a Source #

Plutus Tx version of head.

last ∷ [a] → a Source #

Plutus Tx version of last.

tail ∷ [a] → [a] Source #

Plutus Tx version of tail.

takeInteger → [a] → [a] Source #

Plutus Tx version of take.

dropInteger → [a] → [a] Source #

Plutus Tx version of drop.

splitAtInteger → [a] → ([a], [a]) Source #

Plutus Tx version of splitAt.

nubEq a ⇒ [a] → [a] Source #

Plutus Tx version of nub.

nubBy ∷ (a → a → Bool) → [a] → [a] Source #

Plutus Tx version of nubBy.

zipWith ∷ ∀ a b c. (a → b → c) → [a] → [b] → [c] Source #

Plutus Tx version of zipWith.

dropWhile ∷ ∀ a. (a → Bool) → [a] → [a] Source #

Plutus Tx version of dropWhile.

replicate ∷ ∀ a. Integer → a → [a] Source #

Plutus Tx version of replicate.

partition ∷ (a → Bool) → [a] → ([a], [a]) Source #

Plutus Tx version of partition.

sortOrd a ⇒ [a] → [a] Source #

Plutus Tx version of sort.

sortBy ∷ (a → a → Ordering) → [a] → [a] Source #

Plutus Tx version of sortBy.