AssocMap

scalus.cardano.onchain.plutus.prelude.AssocMap
See theAssocMap companion class
object AssocMap

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
AssocMap.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def empty[A, B]: AssocMap[A, B]
def fromList[A : Eq, B](lst: List[(A, B)]): AssocMap[A, B]
def singleton[A, B](key: A, value: B): AssocMap[A, B]
def union[A : Eq, B, C](lhs: AssocMap[A, B], rhs: AssocMap[A, C]): AssocMap[A, These[B, C]]
inline def unsafeFromList[A, B](lst: List[(A, B)]): AssocMap[A, B]

Concrete fields

lazy val sirDeps: List[SIRModuleWithDeps]
lazy val sirModule: Module

Givens

Givens

given AssocMapFromData[A : Eq, B : FromData]: FromData[AssocMap[A, B]]
inline given assocMapNoEq[A, B]: Eq[AssocMap[A, B]]

AssocMap intentionally has no usable Eq: its equality is order-insensitive (same size, every key maps to an equal value), which is non-structural and cannot be expressed by the structural-equality lowering. This given only produces a clear compile error if someone writes m1 === m2 / m1 == m2, or Eq.derived for a type with an AssocMap field. Use AssocMapEq.equals instead.

AssocMap intentionally has no usable Eq: its equality is order-insensitive (same size, every key maps to an equal value), which is non-structural and cannot be expressed by the structural-equality lowering. This given only produces a clear compile error if someone writes m1 === m2 / m1 == m2, or Eq.derived for a type with an AssocMap field. Use AssocMapEq.equals instead.

Attributes

given assocMapToData[A : ToData, B : ToData]: ToData[AssocMap[A, B]]

Extensions

Extensions

extension [A, B](self: AssocMap[A, B])
def exists(f: ((A, B)) => Boolean): Boolean
def filter(predicate: ((A, B)) => Boolean): AssocMap[A, B]
def filterKeys(predicate: A => Boolean): AssocMap[A, B]
def filterNot(predicate: ((A, B)) => Boolean): AssocMap[A, B]
def find(predicate: ((A, B)) => Boolean): Option[(A, B)]
def foldLeft[C](init: C)(combiner: (C, (A, B)) => C): C
def foldRight[C](init: C)(combiner: ((A, B), C) => C): C
def forall(f: ((A, B)) => Boolean): Boolean
inline def isEmpty: Boolean
def keys: List[A]
inline def length: BigInt
def mapValues[C](f: B => C): AssocMap[A, C]
inline def nonEmpty: Boolean
inline def size: BigInt
def toPairList: PairList[A, B]
def values: List[B]
extension [A, B](self: AssocMap[A, B])(implicit evidence$1: Eq[A])
def contains: Boolean
def delete: AssocMap[A, B]
def get: Option[B]

Optionally returns the value associated with a key.

Optionally returns the value associated with a key.

Value parameters

key

the key value

Attributes

Returns

an option value containing the value associated with key in this map, or None if none exists.

def insert: AssocMap[A, B]