DeepDive.Comparer (Deep Dive v1.0.0) View Source
This module holds the logic to match the keys in a data structure.
Link to this section Summary
Types
A fuzzy_matcher
is one that may return upon match more than one result.
A matcher
is any type that may be compared to a key. There are two special cases
Functions
This function retrieves all the matches of matcher
. The return value is a list of the
key-value tuples.
This function retrieves the first match of matcher
and the corresponting matching key.
In case of no match, it returns nil
.
Link to this section Types
Specs
A fuzzy_matcher
is one that may return upon match more than one result.
Specs
A matcher
is any type that may be compared to a key. There are two special cases:
- A
Regex
, is compared with=~
. - A function of kind
term -> bool
, is applied to the key to verify the match. - Anything else is matched via
==
.
Link to this section Functions
Specs
get_all_keys(map(), matcher()) :: DeepDive.result()
This function retrieves all the matches of matcher
. The return value is a list of the
key-value tuples.
Note also that this function operates only at the first level and does not steps into the key values.
Specs
This function retrieves the first match of matcher
and the corresponting matching key.
In case of no match, it returns nil
.