This is what Erlang has and it’s very convenient since once a design is fixed, I end up writing a spec to remind me what types the function expects.
[1] = https://www.erlang.org/doc/system/typespec.html
@spec foo(String.t()) :: String.t() def foo(bar)
def foo(String.t() bar): String.t()
This is what Erlang has and it’s very convenient since once a design is fixed, I end up writing a spec to remind me what types the function expects.
[1] = https://www.erlang.org/doc/system/typespec.html