plutus-core-1.36.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Name.UniqueMap

Description

A type for maps (key-value associations), where the key type can be identified by Uniques. In practice, these types are usually names. This approach is preferred when it is more efficient to compare the associated Uniques instead of the underlying type.

Synopsis

Documentation

newtype UniqueMap unique a Source #

A mapping from Uniques to arbitrary values of type a. Since Unique is equivalent to Int (see PlutusCore.Name.Unique), we can use an IntMap representation for this type.

Constructors

UniqueMap 

Fields

Instances

Instances details
Foldable (UniqueMap unique) Source # 
Instance details

Defined in PlutusCore.Name.UniqueMap

Methods

foldMonoid m ⇒ UniqueMap unique m → m Source #

foldMapMonoid m ⇒ (a → m) → UniqueMap unique a → m Source #

foldMap'Monoid m ⇒ (a → m) → UniqueMap unique a → m Source #

foldr ∷ (a → b → b) → b → UniqueMap unique a → b Source #

foldr' ∷ (a → b → b) → b → UniqueMap unique a → b Source #

foldl ∷ (b → a → b) → b → UniqueMap unique a → b Source #

foldl' ∷ (b → a → b) → b → UniqueMap unique a → b Source #

foldr1 ∷ (a → a → a) → UniqueMap unique a → a Source #

foldl1 ∷ (a → a → a) → UniqueMap unique a → a Source #

toListUniqueMap unique a → [a] Source #

nullUniqueMap unique a → Bool Source #

lengthUniqueMap unique a → Int Source #

elemEq a ⇒ a → UniqueMap unique a → Bool Source #

maximumOrd a ⇒ UniqueMap unique a → a Source #

minimumOrd a ⇒ UniqueMap unique a → a Source #

sumNum a ⇒ UniqueMap unique a → a Source #

productNum a ⇒ UniqueMap unique a → a Source #

Functor (UniqueMap unique) Source # 
Instance details

Defined in PlutusCore.Name.UniqueMap

Methods

fmap ∷ (a → b) → UniqueMap unique a → UniqueMap unique b Source #

(<$) ∷ a → UniqueMap unique b → UniqueMap unique a Source #

Monoid (UniqueMap unique a) Source # 
Instance details

Defined in PlutusCore.Name.UniqueMap

Methods

memptyUniqueMap unique a Source #

mappendUniqueMap unique a → UniqueMap unique a → UniqueMap unique a Source #

mconcat ∷ [UniqueMap unique a] → UniqueMap unique a Source #

Semigroup (UniqueMap unique a) Source # 
Instance details

Defined in PlutusCore.Name.UniqueMap

Methods

(<>)UniqueMap unique a → UniqueMap unique a → UniqueMap unique a Source #

sconcatNonEmpty (UniqueMap unique a) → UniqueMap unique a Source #

stimesIntegral b ⇒ b → UniqueMap unique a → UniqueMap unique a Source #

Show a ⇒ Show (UniqueMap unique a) Source # 
Instance details

Defined in PlutusCore.Name.UniqueMap

Methods

showsPrecIntUniqueMap unique a → ShowS Source #

showUniqueMap unique a → String Source #

showList ∷ [UniqueMap unique a] → ShowS Source #

Eq a ⇒ Eq (UniqueMap unique a) Source # 
Instance details

Defined in PlutusCore.Name.UniqueMap

Methods

(==)UniqueMap unique a → UniqueMap unique a → Bool Source #

(/=)UniqueMap unique a → UniqueMap unique a → Bool Source #

insertByUniqueCoercible unique Unique ⇒ unique → a → UniqueMap unique a → UniqueMap unique a Source #

Insert a value a by a unique.

insertByNameHasUnique name unique ⇒ name → a → UniqueMap unique a → UniqueMap unique a Source #

Insert a value a by the unique of a name.

singletonByNameHasUnique name unique ⇒ name → a → UniqueMap unique a Source #

Create the singleton map of the unique of a name and a value a.

insertNamed ∷ (HasText name, HasUnique name unique) ⇒ name → a → UniqueMap unique (Named a) → UniqueMap unique (Named a) Source #

Insert a named value a by the index of the unique of the name.

insertByNameIndex ∷ (HasUnique name unique1, Coercible unique2 Unique) ⇒ name → a → UniqueMap unique2 a → UniqueMap unique2 a Source #

Insert a value by the index of the unique of a name. Unlike insertByUnique and insertByName, this function does not provide any static guarantees, so you can for example insert by a type-level name in a map from term-level uniques.

fromFoldableFoldable f ⇒ (i → a → UniqueMap unique a → UniqueMap unique a) → f (i, a) → UniqueMap unique a Source #

Convert a Foldable into a UniqueMap using the given insertion function.

fromUniquesFoldable f ⇒ Coercible Unique unique ⇒ f (unique, a) → UniqueMap unique a Source #

Convert a Foldable with uniques into a UniqueMap.

fromNamesFoldable f ⇒ HasUnique name unique ⇒ f (name, a) → UniqueMap unique a Source #

Convert a Foldable with names into a UniqueMap.

lookupUniqueCoercible unique Unique ⇒ unique → UniqueMap unique a → Maybe a Source #

Look up a value by a unique.

lookupNameHasUnique name unique ⇒ name → UniqueMap unique a → Maybe a Source #

Look up a value by the unique of a name.

restrictKeysUniqueMap unique v → UniqueSet unique → UniqueMap unique v Source #

lookupNameIndex ∷ (HasUnique name unique1, Coercible unique2 Unique) ⇒ name → UniqueMap unique2 a → Maybe a Source #

Look up a value by the index of the unique of a name. Unlike lookupUnique and lookupName, this function does not provide any static guarantees, so you can for example look up a type-level name in a map from term-level uniques.