Skip to content
Effect Days 2026 Get your ticket

MutableHashMap

17 exports Added in v2.0.0 Source

Constructors

empty

Added in v2.0.0 Source

Signature

declare function empty<K = never, V = never>(): MutableHashMap<K, V>

fromIterable

Added in v2.0.0 Source

Creates a new MutableHashMap from an iterable collection of key/value pairs.

Signature

declare function fromIterable<K, V>(entries: Iterable<readonly [K, V]>): MutableHashMap<K, V>

make

Added in v2.0.0 Source

Signature

declare const make: <Entries extends Array<readonly [any, any]>>(...entries: Entries) => MutableHashMap<Entries[number] extends readonly [infer K, any] ? K : never, Entries[number] extends readonly [any, infer V] ? V : never>

Elements

get

Added in v2.0.0 Source

Signature

declare const get: {
<K>(key: K): <V>(self: MutableHashMap<K, V>) => Option<V>;
<K, V>(self: MutableHashMap<K, V>, key: K): Option<V>;
}

has

Added in v2.0.0 Source

Signature

declare const has: {
<K>(key: K): <V>(self: MutableHashMap<K, V>) => boolean;
<K, V>(self: MutableHashMap<K, V>, key: K): boolean;
}

keys

Added in v3.8.0 Source

Signature

declare function keys<K, V>(self: MutableHashMap<K, V>): Array<K>

size

Added in v2.0.0 Source

Signature

declare function size<K, V>(self: MutableHashMap<K, V>): number

values

Added in v3.8.0 Source

Signature

declare function values<K, V>(self: MutableHashMap<K, V>): Array<V>

Models

MutableHashMap interface

Added in v2.0.0 Source

Signature

interface MutableHashMap<out K, out V> extends Iterable<[K, V]>, Pipeable, Inspectable {
readonly [TypeId]: typeof TypeId;
}

Other

clear

Added in v2.0.0 Source

Signature

declare function clear<K, V>(self: MutableHashMap<K, V>): MutableHashMap<K, V>

forEach

Added in v2.0.0 Source

Signature

declare const forEach: {
<K, V>(f: (value: V, key: K) => void): (self: MutableHashMap<K, V>) => void;
<K, V>(self: MutableHashMap<K, V>, f: (value: V, key: K) => void): void;
}

isEmpty

Added in v2.0.0 Source

Signature

declare function isEmpty<K, V>(self: MutableHashMap<K, V>): boolean

modify

Added in v2.0.0 Source

Updates the value of the specified key within the MutableHashMap if it exists.

Signature

declare const modify: {
<K, V>(key: K, f: (v: V) => V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(self: MutableHashMap<K, V>, key: K, f: (v: V) => V): MutableHashMap<K, V>;
}

modifyAt

Added in v2.0.0 Source

Set or remove the specified key in the MutableHashMap using the specified update function.

Signature

declare const modifyAt: {
<K, V>(key: K, f: (value: Option<V>) => Option<V>): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(self: MutableHashMap<K, V>, key: K, f: (value: Option<V>) => Option<V>): MutableHashMap<K, V>;
}

remove

Added in v2.0.0 Source

Signature

declare const remove: {
<K>(key: K): <V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(self: MutableHashMap<K, V>, key: K): MutableHashMap<K, V>;
}

set

Added in v2.0.0 Source

Signature

declare const set: {
<K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>;
}

Symbol

TypeId type

Added in v2.0.0 Source

Signature

type TypeId = typeof TypeId