FpdartOnMutableMap<K, V> extension

Functional programming functions on a mutable dart Map using fpdart.

on

Properties

size int
Return number of keys in the Map.
no setter

Methods

collect<A>(Order<K> order) Iterable<A> Function(A (K key, V value))
Collect all the entries in this Map into an Iterable using fun with the values ordered using order.
deleteAt(Eq<K> eq) Map<K, V> Function(K key)
Delete value and key at given key in the Map and return updated Map.
difference(Eq<K> eq) Map<K, V> Function(Map<K, V> map)
Remove from this Map all the elements that have key contained in the given map.
elem(V value) bool
Test whether or not value exists in this Map
extract<T>(K key) Option<T>
Return an Option that conditionally accesses map keys, only if they match the given type. Useful for accessing nested JSON.
extractMap(K key) Option<Map<K, dynamic>>
Return an Option that conditionally accesses map keys, if they contain a map with the same key type. Useful for accessing nested JSON.
filter(bool predicate(V value)) Map<K, V>
Returns the list of those elements of the Map whose value satisfies predicate.
filterWithIndex(bool predicate(V value, int index)) Map<K, V>
Returns the list of those elements of the Map whose value satisfies predicate.
filterWithKey(bool predicate(K key, V value)) Map<K, V>
Returns the list of those elements of the Map whose key/value satisfies predicate.
filterWithKeyAndIndex(bool predicate(K key, V value, int index)) Map<K, V>
Returns the list of those elements of the Map whose key/value satisfies predicate.
foldLeft<A>(Order<K> order) → A Function(A initial, A fun(A acc, V value))
Apply fun to all the values of this Map sorted based on order on their key, and return the result of combining all the intermediate values.
foldLeftWithIndex<A>(Order<K> order) → A Function(A initial, A fun(A acc, V value, int index))
Apply fun to all the values of this Map sorted based on order on their key, passing also the current index of the iteration, and return the result of combining all the intermediate values.
foldLeftWithKey<A>(Order<K> order) → A Function(A initial, A fun(A acc, K key, V value))
Apply fun to all the values of this Map sorted based on order on their key, and return the result of combining all the intermediate values.
foldLeftWithKeyAndIndex<A>(Order<K> order) → A Function(A initial, A fun(A acc, K key, V value, int index))
Apply fun to all the values of this Map sorted based on order on their key, passing also the current index of the iteration, and return the result of combining all the intermediate values.
foldRight<A>(Order<K> order) → A Function(A initial, A fun(V value, A acc))
Apply fun to all the values of this Map sorted based on the inverse of order on their key, and return the result of combining all the intermediate values.
foldRightWithIndex<A>(Order<K> order) → A Function(A initial, A fun(V value, A acc, int index))
Apply fun to all the values of this Map sorted based on the inverse of order on their key, passing also the current index of the iteration, and return the result of combining all the intermediate values.
foldRightWithKey<A>(Order<K> order) → A Function(A initial, A fun(K key, V value, A acc))
Apply fun to all the values of this Map sorted based on the inverse of order on their key, and return the result of combining all the intermediate values.
foldRightWithKeyAndIndex<A>(Order<K> order) → A Function(A initial, A fun(K key, V value, A acc, int index))
Apply fun to all the values of this Map sorted based on the inverse of order on their key, passing also the current index of the iteration, and return the result of combining all the intermediate values.
intersection(Eq<K> eq, Magma<V> combine) Map<K, V> Function(Map<K, V> map)
Intersect the key/value of two Map using combine where the key is the same.
isSubmap(Eq<K> eqK) bool Function(Map<K, V>) Function(Eq<V>)
Test whether or not the given map contains all of the keys and values contained in this Map.
lookup(K key) Option<V>
Get the value at given key if present, otherwise return None.
lookupWithKey(K key) Option<Tuple2<K, V>>
Get the value and key at given key if present, otherwise return None.
mapValue<A>(A update(V value)) Map<K, A>
Convert each value of the Map using the update function and returns a new Map.
mapWithIndex<A>(A update(V value, int index)) Map<K, A>
Convert each value of the Map using the update function and returns a new Map.
member(K key) bool
Test whether or not key exists in this Map
modifyAt(Eq<K> eq) Option<Map<K, V>> Function(K key, V (V value))
If the given key is present in the Map, then modify its value using modify and return a the new Map. Otherwise, return None.
modifyAtIfPresent(Eq<K> eq) Map<K, V> Function(K key, V (V value))
If the given key is present in the Map, then modify its value using modify and return a the new Map. Otherwise, return the original unmodified Map.
pop(Eq<K> eq) Option<Tuple2<V, Map<K, V>>> Function(K key)
Delete a key and value from a this Map, returning the deleted value as well as the subsequent Map.
toIterable(Order<K> order) Iterable<MapEntry<K, V>>
Get a sorted Iterable of the key/value pairs contained in this Map.
union(Eq<K> eq, Magma<V> combine) Map<K, V> Function(Map<K, V> map)
Combine the key/value of two Map using combine where the key is the same.
updateAt(Eq<K> eq) Option<Map<K, V>> Function(K key, V value)
If the given key is present in the Map, then update its value to value. Otherwise, return None.
updateAtIfPresent(Eq<K> eq) Map<K, V> Function(K key, V value)
If the given key is present in the Map, then update its value to value. Otherwise, return the original unmodified Map.
upsertAt(Eq<K> eq) Map<K, V> Function(K key, V value)
Insert or replace a key/value pair in a Map.