How can I write in Erlang an equivalent of this Haskell snippet?
name@(x:xs)
You can do it with syntax like Name=[X|Xs]. An example usage is
Name=[X|Xs]
headlist([H|T]=L) -> io:format("List (~p) with head ~p ~n",[L,H]).