View Source Erlang Generized Data Structure Library
Everyone has to reinvent this wheel, here's my version
A simple library for doing common things with common Erlang data structures (proplists, dicts, and maps for now). all with the same function calls. These all follow certain conventions:
- Calls are short (
ds:getinstead ofproplists:get_valueorlists:keyfind). - Perform inline actions with some standardized procedures for common things (e.g.
ds:atomize(Obj, [key1, key2])converts the values of the associated keyskey1andkey2into atoms and returns the new Object - Filtering Keys (
ds:keep(Obj, [good_key, other_good_key])removes all keys from the Object that aren't missing. The reverse of this isds:delete_list(Obj, [bad_key, other_bad_key]) - Merging objects
- Provides a helper for sorting lists of objects
- All functions will return the same object type as was passed in. So if
Objis a proplist, it will return a proplist. IfObjis a map, it will return a map, etc.
More documentation to come
add-to-your-rebar-config-s-deps-section
Add to your rebar.config's deps section
{deps, [
erlang_ds
]}.
about
About
Author: Jesse Gumm
MIT License