/** * @since 2.0.0 */ import { Compactable2, Separated } from './Compactable' import { Either } from './Either' import { Eq } from './Eq' import { Filterable2 } from './Filterable' import { FilterableWithIndex2C } from './FilterableWithIndex' import { Foldable, Foldable1, Foldable2, Foldable3 } from './Foldable' import { Predicate, Refinement } from './function' import { Functor2 } from './Functor' import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from './HKT' import { Magma } from './Magma' import { Monoid } from './Monoid' import { Option } from './Option' import { Ord } from './Ord' import { Semigroup } from './Semigroup' import { Show } from './Show' import { TraversableWithIndex2C } from './TraversableWithIndex' import { Unfoldable, Unfoldable1 } from './Unfoldable' import { Witherable2C } from './Witherable' /** * @category instances * @since 2.0.0 */ export declare const getShow: (SK: Show, SA: Show) => Show> /** * Calculate the number of key/value pairs in a map * * @since 2.0.0 */ export declare const size: (d: Map) => number /** * Test whether or not a map is empty * * @since 2.0.0 */ export declare const isEmpty: (d: Map) => boolean /** * Test whether or not a key exists in a map * * @since 2.0.0 */ export declare const member: ( E: Eq ) => { (k: K): (m: Map) => boolean (k: K, m: Map): boolean } /** * Test whether or not a value is a member of a map * * @since 2.0.0 */ export declare const elem: ( E: Eq ) => { (a: A): (m: Map) => boolean (a: A, m: Map): boolean } /** * Get a sorted array of the keys contained in a map * * @since 2.0.0 */ export declare const keys: (O: Ord) => (m: Map) => Array /** * Get a sorted array of the values contained in a map * * @since 2.0.0 */ export declare const values: (O: Ord) => (m: Map) => Array /** * @since 2.0.0 */ export declare const collect: (O: Ord) => (f: (k: K, a: A) => B) => (m: Map) => Array /** * Get a sorted of the key/value pairs contained in a map * * @since 2.0.0 */ export declare const toArray: (O: Ord) => (m: Map) => Array<[K, A]> /** * Unfolds a map into a list of key/value pairs * * @since 2.0.0 */ export declare function toUnfoldable( O: Ord, U: Unfoldable1 ): (d: Map) => Kind export declare function toUnfoldable(O: Ord, U: Unfoldable): (d: Map) => HKT /** * Insert or replace a key/value pair in a map * * @category combinators * @since 2.0.0 */ export declare const insertAt: (E: Eq) => (k: K, a: A) => (m: Map) => Map /** * Delete a key and value from a map * * @category combinators * @since 2.0.0 */ export declare const deleteAt: (E: Eq) => (k: K) => (m: Map) => Map /** * @since 2.0.0 */ export declare const updateAt: (E: Eq) => (k: K, a: A) => (m: Map) => Option> /** * @since 2.0.0 */ export declare const modifyAt: (E: Eq) => (k: K, f: (a: A) => A) => (m: Map) => Option> /** * Delete a key and value from a map, returning the value as well as the subsequent map * * @since 2.0.0 */ export declare const pop: (E: Eq) => (k: K) => (m: Map) => Option<[A, Map]> /** * Lookup the value for a key in a `Map`. * If the result is a `Some`, the existing key is also returned. * * @since 2.0.0 */ export declare const lookupWithKey: ( E: Eq ) => { (k: K): (m: Map) => Option<[K, A]> (k: K, m: Map): Option<[K, A]> } /** * Lookup the value for a key in a `Map`. * * @since 2.0.0 */ export declare const lookup: ( E: Eq ) => { (k: K): (m: Map) => Option (k: K, m: Map): Option } /** * Test whether or not one `Map` contains all of the keys and values contained in another `Map` * * @since 2.0.0 */ export declare const isSubmap: ( SK: Eq, SA: Eq ) => { (that: Map): (me: Map) => boolean (me: Map, that: Map): boolean } /** * @since 2.0.0 */ export declare const empty: Map /** * @category instances * @since 2.0.0 */ export declare const getEq: (SK: Eq, SA: Eq) => Eq> /** * Gets `Monoid` instance for Maps given `Semigroup` instance for their values * * @category instances * @since 2.0.0 */ export declare const getMonoid: (SK: Eq, SA: Semigroup) => Monoid> /** * Create a map with one key/value pair * * @since 2.0.0 */ export declare const singleton: (k: K, a: A) => Map /** * Create a map from a foldable collection of key/value pairs, using the * specified `Magma` to combine values for duplicate keys. * * @category constructors * @since 2.0.0 */ export declare function fromFoldable( E: Eq, M: Magma, F: Foldable3 ): (fka: Kind3) => Map export declare function fromFoldable( E: Eq, M: Magma, F: Foldable2 ): (fka: Kind2) => Map export declare function fromFoldable( E: Eq, M: Magma, F: Foldable1 ): (fka: Kind) => Map export declare function fromFoldable(E: Eq, M: Magma, F: Foldable): (fka: HKT) => Map /** * @category Compactable * @since 2.0.0 */ export declare const compact: (fa: Map>) => Map /** * @category Filterable * @since 2.0.0 */ export declare const filter: { (refinement: Refinement): (fa: Map) => Map (predicate: Predicate): (fa: Map) => Map } /** * @category Filterable * @since 2.0.0 */ export declare const filterMap: (f: (a: A) => Option) => (fa: Map) => Map /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. * * @category Functor * @since 2.0.0 */ export declare const map: (f: (a: A) => B) => (fa: Map) => Map /** * @category FunctorWithIndex * @since 2.7.1 */ export declare const mapWithIndex: (f: (k: K, a: A) => B) => (fa: Map) => Map /** * @category Filterable * @since 2.0.0 */ export declare const partition: { (refinement: Refinement): (fa: Map) => Separated, Map> (predicate: Predicate): (fa: Map) => Separated, Map> } /** * @category Filterable * @since 2.0.0 */ export declare const partitionMap: ( f: (a: A) => Either ) => (fa: Map) => Separated, Map> /** * @category Compactable * @since 2.0.0 */ export declare const separate: (fa: Map>) => Separated, Map> /** * @category instances * @since 2.0.0 */ export declare const URI = 'Map' /** * @category instances * @since 2.0.0 */ export declare type URI = typeof URI declare module './HKT' { interface URItoKind2 { readonly [URI]: Map } } /** * @category instances * @since 2.0.0 */ export declare const getFilterableWithIndex: () => FilterableWithIndex2C /** * @category instances * @since 2.0.0 */ export declare const getWitherable: (O: Ord) => Witherable2C & TraversableWithIndex2C /** * @category instances * @since 2.7.0 */ export declare const Functor: Functor2 /** * @category instances * @since 2.7.0 */ export declare const Compactable: Compactable2 /** * @category instances * @since 2.7.0 */ export declare const Filterable: Filterable2 /** * @category instances * @since 2.0.0 */ export declare const map_: Filterable2