Pdl (Pdl v0.1.1)

View Source

Summary

Functions

Adds value to key in the process dictionary.

Adds value to key in the process dictionary.

Adds multiple values to key in the process dictionary.

Adds multiple values to key in the process dictionary.

Fetches the value stored in key in the process dictionary.

Fetches the value stored in key in the process dictionary.

Runs the given fun over every value stored in key in the process dictionary, receiving each value as an argument to fun

Runs the given fun over the entire value stored in the process dictionary key.

Runs the given fun over every unique value stored in key in the process dictionary, receiving each value as an argument to fun

Functions

add(key, value)

@spec add(key :: term(), value :: term()) :: :ok | {:error, String.t()}

Adds value to key in the process dictionary.

Returns error if key already exists in the process dictionary and is not a list.

add!(key, value)

@spec add!(key :: term(), value :: term()) :: :ok

Adds value to key in the process dictionary.

Raises if key already exists in the process dictionary and is not a list.

add_many(key, values)

@spec add_many(term(), [term()]) :: :ok | {:error, String.t()}

Adds multiple values to key in the process dictionary.

Returns error if key already exists in the process dictionary and is not a list.

add_many!(key, values)

@spec add_many!(term(), [term()]) :: :ok

Adds multiple values to key in the process dictionary.

Raises if key already exists in the process dictionary and is not a list.

get(key)

@spec get(term()) :: [term()] | {:error, String.t()}

Fetches the value stored in key in the process dictionary.

Errors if the value is not a list

get!(key)

@spec get!(term()) :: [term()]

Fetches the value stored in key in the process dictionary.

Raises if the value is not a list

run(key, fun)

@spec run(term(), (term() -> term())) :: [term()]

Runs the given fun over every value stored in key in the process dictionary, receiving each value as an argument to fun

Returns a list of the results of fun.

run_all(key, fun)

@spec run_all(term(), ([term()] -> term())) :: term()

Runs the given fun over the entire value stored in the process dictionary key.

Returns the result of fun.

run_unique(key, fun)

@spec run_unique(term(), (term() -> term())) :: [term()]

Runs the given fun over every unique value stored in key in the process dictionary, receiving each value as an argument to fun

Returns a list of the results of fun.