Cost

data class Cost<C : CostMonoid<C>>(val features: PersistentMap<CostFeature, C>) : CostMonoid<Cost<C>> , Map<CostFeature, C> , PrettyPrintable

The cost of executing a piece of code or sending a message. Consists of a map of features over some cost monoid.

Constructors

Link copied to clipboard
fun <C : CostMonoid<C>> Cost(features: PersistentMap<CostFeature, C>)

Functions

Link copied to clipboard
open override fun concat(other: Cost<C>): Cost<C>
Link copied to clipboard
open override fun containsKey(key: CostFeature): Boolean
Link copied to clipboard
open override fun containsValue(value: C): Boolean
Link copied to clipboard
fun <D : CostMonoid<D>> featureMap(f: (CostFeature, C) -> D): Cost<D>
Link copied to clipboard
open fun forEach(p0: BiConsumer<in CostFeature, in C>)
Link copied to clipboard
open operator override fun get(key: CostFeature): C?
Link copied to clipboard
open fun getOrDefault(key: CostFeature, defaultValue: C): C
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
fun <D : CostMonoid<D>> map(f: (C) -> D): Cost<D>
Link copied to clipboard
open override fun toDocument(): Document
Link copied to clipboard
fun update(feature: CostFeature, cost: C): Cost<C>
Link copied to clipboard
open override fun zero(): Cost<C>

Properties

Link copied to clipboard
open override val entries: Set<Map.Entry<CostFeature, C>>
Link copied to clipboard
val features: PersistentMap<CostFeature, C>
Link copied to clipboard
open override val keys: Set<CostFeature>
Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val values: Collection<C>