Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/elixir/lib/dict/behaviour.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
defmodule Dict.Behaviour do
@moduledoc """
Default implementations for some required functions in the `Dict` module.

This module makes it easier to create your own `Dict` compliant
module, by providing default implementations for some required functions.

Expand All @@ -13,16 +15,16 @@ defmodule Dict.Behaviour do
# override default implementations if needed
end

The client module must contain following functions:
The client module must contain the following functions:

* `delete/2`
* `fetch/2`,
* `fetch/2`
* `put/3`
* `reduce/3`
* `size/1`
* `update/4`

All of them are part of the Dict behaviour, so no extra functions are
All of which are part of the `Dict` behaviour, so no extra functions are
actually required.

Based on these functions, `Dict.Behaviour` generates default implementations
Expand All @@ -42,7 +44,7 @@ defmodule Dict.Behaviour do
* `to_list/1`
* `values/1`

All of the functions are defined as overridable, so you can provide your own
All of these functions are defined as overridable, so you can provide your own
implementation if needed.

Note you can also test your custom module via `Dict`'s doctests:
Expand Down