Mail.Proplist (mail v0.2.3) View Source
A hybrid of Erlang's proplists and lists keystores.
It acts as a Set for key-value pairs, but still maintains it's order like a List.
Link to this section Summary
Functions
Removes a key-value pair by the given key and returns the remaining list
Drops the specified keys from the list, returning the remaining.
Filters the proplist, i.e. returns only those elements
for which fun
returns a truthy value.
Retrieves a value from the list
Detects if the list contains the specified key.
Retrieves all keys from the key value pairs present in the list, unlike :proplists.get_keys which will return non-kv pairs as keys
Concatenates the given lists.
Merges duplicate pairs with the latest value.
Prepends the key-value pair to the list if it doesn't already exist, otherwise it will replace the existing pair
Stores a key-value pair in the list, will replace an existing pair with the same key.
Takes the specified keys from the list, returning the remaining.
Link to this section Types
Specs
Link to this section Functions
Specs
Removes a key-value pair by the given key and returns the remaining list
Args:
list
- the list to remove the pair fromkey
- the key to remove
Specs
Drops the specified keys from the list, returning the remaining.
Args:
list
- the listkeys
- the keys to remove
Specs
Filters the proplist, i.e. returns only those elements
for which fun
returns a truthy value.
Args:
list
- the list to filterfunc
- the function to execute
Retrieves a value from the list
Args:
list
- the list to look inkey
- the key of the pair to retrieve it's value
Specs
Detects if the list contains the specified key.
Args:
list
- the list to look inkey
- the key to look for
Specs
Retrieves all keys from the key value pairs present in the list, unlike :proplists.get_keys which will return non-kv pairs as keys
Args:
list
- a list to retrieve all the keys from
Specs
Concatenates the given lists.
Args:
a
- base list to merge untob
- list to merge with
Specs
Merges duplicate pairs with the latest value.
Args:
list
- the list to normalize
Specs
Prepends the key-value pair to the list if it doesn't already exist, otherwise it will replace the existing pair
Args:
list
- the list to store inkey
- the key of the pairvalue
- the value of the pair
Specs
Stores a key-value pair in the list, will replace an existing pair with the same key.
Args:
list
- the list to store inkey
- the key of the pairvalue
- the value of the pair
Specs
Takes the specified keys from the list, returning the remaining.
Args:
list
- the listkeys
- the keys to keep