I'm trying to follow a tutorial on Erlang lists and I'm having difficulty passing an argument to a list. The following is the code, I'm unsure how to run it, I get the error,
exception error: no function clause matching insert
I've tried
cases:insert(1,[0]).
on the command line and many others...
-module(cases).
-export([insert/2]).
insert(X,[]) ->
[X];
insert(X,Set) ->
case lists:member(X,Set) of
true -> Set;
false -> [X|Set]
end.