A silly library that lets you use @behave instead of @behaviour (with a use trade-off).
Installation
def deps do
[
{:well_behaved, "~> 1.0"}
]
endExample
You can use:
defmodule MyModule do
use WellBehaved
@behave TestBehaviorA
@impl TestBehaviorA
def test_a, do: :ok
@impl TestBehaviorA
def function_a(arg), do: {:hello, arg}
endInstead of:
defmodule MyModule do
@behaviour TestBehaviorA
@impl TestBehaviorA
def test_a, do: :ok
@impl TestBehaviorA
def function_a(arg), do: {:hello, arg}
endWhy?
- 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 a borrowing from Old French