FuncType - v0.8.85
    Preparing search index...

    Interface Map<K, V>

    A traversable interface for map that excludes map and flatMap operations

    interface Map<K, V> {
        _tag: "Map";
        isEmpty: boolean;
        size: number;
        add(item: Tuple<[K, V]>): Map<K, V>;
        ap<U>(ff: Map<K, (value: V) => U>): Map<K, U>;
        contains(value: Tuple): boolean;
        flatMap<K2, V2>(
            f: (entry: Tuple<[K, V]>) => Iterable<[K2, V2]>,
        ): Map<K2, V2>;
        flatMapAsync<U>(
            f: (value: V) => PromiseLike<Map<K, U>>,
        ): PromiseLike<Map<K, U>>;
        fold<U extends unknown>(
            onEmpty: () => U,
            onValue: (value: Tuple<[K, V]>) => U,
        ): U;
        foldLeft<B>(z: B): (op: (b: B, a: Tuple<[K, V]>) => B) => B;
        foldRight<B>(z: B): (op: (a: Tuple<[K, V]>, b: B) => B) => B;
        get(key: K): Option<V>;
        getOrElse(key: K, defaultValue: V): V;
        map<U>(f: (value: V) => U): Map<K, U>;
        match<R>(
            patterns: { Empty: () => R; NonEmpty: (entries: Tuple<[K, V]>[]) => R },
        ): R;
        orElse(key: K, alternative: Option<V>): Option<V>;
        pipe<U extends unknown>(f: (value: [K, V][]) => U): U;
        reduce(f: (b: Tuple, a: Tuple) => Tuple): Tuple;
        reduceRight(f: (b: Tuple, a: Tuple) => Tuple): Tuple;
        remove(value: K): Map<K, V>;
        serialize(): SerializationMethods<[K, V][]>;
        toList(): List<Tuple<[K, V]>>;
        toSet(): Set<Tuple<[K, V]>>;
        toString(): string;
        toValue(): { _tag: "Map"; value: [K, V][] };
    }

    Type Parameters

    • K
    • V

    Hierarchy (View Summary)

    Index

    Properties

    _tag: "Map"
    isEmpty: boolean
    size: number

    Methods

    • Type Parameters

      • U

      Parameters

      Returns Map<K, U>

    • Parameters

      Returns boolean

    • Type Parameters

      • U

      Parameters

      • f: (value: V) => PromiseLike<Map<K, U>>

      Returns PromiseLike<Map<K, U>>

    • Pattern matches over the structure, applying specific handlers for each variant

      Type Parameters

      • U extends unknown

      Parameters

      • onEmpty: () => U

        Function to apply if the structure is empty or has no value

      • onValue: (value: Tuple<[K, V]>) => U

        Function to apply if the structure has a value

      Returns U

      The result of applying the appropriate function

    • Left-associative fold using the provided zero value and operation

      Type Parameters

      • B

      Parameters

      • z: B

        Zero/identity value

      Returns (op: (b: B, a: Tuple<[K, V]>) => B) => B

      A function that takes an operation to apply

    • Right-associative fold using the provided zero value and operation

      Type Parameters

      • B

      Parameters

      • z: B

        Zero/identity value

      Returns (op: (a: Tuple<[K, V]>, b: B) => B) => B

      A function that takes an operation to apply

    • Parameters

      • key: K
      • defaultValue: V

      Returns V

    • Type Parameters

      • U

      Parameters

      • f: (value: V) => U

      Returns Map<K, U>

    • Pattern matches over the Map, applying a handler function based on whether it's empty

      Type Parameters

      • R

      Parameters

      • patterns: { Empty: () => R; NonEmpty: (entries: Tuple<[K, V]>[]) => R }

        Object with handler functions for Empty and NonEmpty variants

      Returns R

      The result of applying the matching handler function

    • Pipes the value through the provided function

      Type Parameters

      • U extends unknown

        The return type of the function

      Parameters

      • f: (value: [K, V][]) => U

        The function to apply to the value

      Returns U

      The result of applying the function to the value

    • Parameters

      • value: K

      Returns Map<K, V>

    • Returns { _tag: "Map"; value: [K, V][] }