Skip to content

Latest commit

 

History

History
159 lines (98 loc) · 1.9 KB

StrMap.md

File metadata and controls

159 lines (98 loc) · 1.9 KB

MODULE StrMap

StrMap

data

constructor(readonly value: { [key: string]: A }) {}

Methods

map

<B>(f: (a: A) => B): StrMap<B>

mapWithKey

<B>(f: (k: string, a: A) => B): StrMap<B>

reduce

<B>(b: B, f: (b: B, a: A) => B): B

strmap

instance

Functor1<URI> & Foldable1<URI> & Traversable1<URI>

collect

function

<A, B>(d: StrMap<A>, f: (k: string, a: A) => B): Array<B>

getMonoid

function

<A = never>(): Monoid<StrMap<A>>

getSetoid

function

<A>(S: Setoid<A>): Setoid<StrMap<A>>

insert

function

<A>(k: string, a: A, d: StrMap<A>): StrMap<A>

Insert or replace a key/value pair in a map

isEmpty

function

<A>(d: StrMap<A>): boolean

Test whether a dictionary is empty

isSubdictionary

function

<A>(S: Setoid<A>) => (d1: StrMap<A>, d2: StrMap<A>): boolean

Test whether one dictionary contains all of the keys and values contained in another dictionary

lookup

function

<A>(k: string, d: StrMap<A>): Option<A>

Lookup the value for a key in a dictionary

pop

function

<A>(k: string, d: StrMap<A>): Option<[A, StrMap<A>]>

Delete a key and value from a map, returning the value as well as the subsequent map

remove

function

<A>(k: string, d: StrMap<A>): StrMap<A>

Delete a key and value from a map

singleton

function

<A>(k: string, a: A): StrMap<A>

Create a dictionary with one key/value pair

size

function

<A>(d: StrMap<A>): number

Calculate the number of key/value pairs in a dictionary

toArray

function

<A>(d: StrMap<A>): Array<[string, A]>

toUnfoldable

function

<F>(unfoldable: Unfoldable<F>) => <A>(d: StrMap<A>): HKT<F, [string, A]>

Unfolds a dictionary into a list of key/value pairs