WellBehaved (WellBehaved v1.0.0)
View Source
A silly library that lets you use @behave
instead of @behaviour
(with a use
trade-off).
Installation
def deps do
[
{:well_behaved, "~> 1.0"}
]
end
Example
You can use:
defmodule MyModule do
use WellBehaved
@behave TestBehaviorA
def test_a, do: :ok
def function_a(arg), do: {:hello, arg}
end
Instead of:
defmodule MyModule do
@behaviour TestBehaviorA
def test_a, do: :ok
def function_a(arg), do: {:hello, arg}
end
Why?
- Elixir Behaviours are super cool
- It uses the UK spelling
- Of all the UK spellings my brain accepts, behaviour is not one of them.
- Every time I sound out be-hav-i-our ... phonetically.
- It's not even french