elixir-lang/elixir — pull request #1571 by sasa1977 (2013-08-08 13:08:21+00:00)
Title: added Dict.Behaviour

Dict.Behaviour helper, as discussed [here](https://groups.google.com/forum/?fromgroups#!topic/elixir-lang-core/BBtbdOv5FcI)

A couple of poins/issues:
1. Perhaps it would be useful if `use Dict.Behaviour` automatically generates `@behaviour Dict`?
2. `Dict.Behaviour` relies on reduce. However, this is not required by the `@behaviour Dict`. Perhaps it would make sense to add this requirement to the behaviour.
3. `HashDict` now relies on `Dict.Behaviour`. This is mostly straightforward, except in `merge` which in `HashDict` has multiple clauses. I made only the last clause to call the default implementation.
4. The doctests rely on existence of `dict_impl`, as suggested in the mailing list thread. This will work only if the dict implementation contains `new/0` and `new/1`. This is again not enforced anywhere.
5. I didn't document the generated functions, because `HashDict` also doesn't document them. If this is needed let me know.