I am new to erlang programming. I have a lot of doubts. One of them is the use of -spec.
What does "-spec" do in Erlang syntax? What is the difference if a function is created with or without -spec
without -spec function
add(A, B) ->
A + B.
with the -spec option
-spec add(Number, Number).
add(A, B) ->
A + B.
I searched on google but couldn't figure out the exact use of -spec. Can someone explain?
source
share