Module type Relude_HMap.HMAP_TYPE
HMAP_TYPE
is a module type signature which captures the types and functions exposed by the HMap.
module Key: { ... };
Key-related types and operations for an HMap
let empty: t;
An empty HMap
let isEmpty: t => bool;
Indicates if the HMap is empty
let remove: keyImpl('a) => t => t;
Creates a new HMap that does not contain a value for the given key
type keyValue
=
;|
KeyValue(keyImpl('a), 'a) : keyValue
The type of a key/value pair in the HMap. The key captures the type of the corresponding value.
let forEach: (keyValue => unit) => t => unit;
Runs a side effect for each key/value pair in the HMap. Note: the KEY_META must provide appropriate functions for converting the existentially typed values into values of a known type.
let fold: (keyValue => 'a => 'a) => 'a => t => 'a;
Folds the HMap into a value. Note the KEY_META must provide appropriate functions for manipulating the values stored for each key.
let all: (keyValue => bool) => t => bool;
Indicates if all key/value pairs in the HMap satisfy the given predicate.
Note the KEY_META must provide appropriate functions for manipulating the values stored for each key.
let any: (keyValue => bool) => t => bool;
Indicates if any key/value pairs in the HMap satisfy the given predicate.
Note the KEY_META must provide appropriate functions for manipulating the values stored for each key.
let filter: (keyValue => bool) => t => t;
Creates a new HMap that only contains the key/value pairs that satisfy the given predicate.
Note the KEY_META must provide appropriate functions for manipulating the values stored for each key.
let size: t => int;
Gets the number of key/value pairs stored in this HMap.