I have started to learn Erlang programming language but now i am trying to write program in functional manner and it is my first program in a functional approach (in whole my life). This program calculate sum of a list items.
total() -> 0;
total([Item|Tail]) -> Item + total(Tail).
have a nice time.