3 ms·
> @spec line in Elixir is just not DRY and inconvenient. I'm guilty of regularly copy/pasting @spec from another function and forgetting to change the name, it
by conradfr 4y ago
> @spec line in Elixir is just not DRY and inconvenient.
I'm guilty of regularly copy/pasting @spec from another function and forgetting to change the name, it's very inconvenient.
I wonder how much work it would be to allow type hints and for Elixir to transform them to specs (and maybe guards) at compile time.
Having made the transition in PHP years ago it always feels a bit archaic to write specs again.
Especially as you kind of doing it already when pattern matching a struct parameter.