aboutsummaryrefslogtreecommitdiff
path: root/learn-you-some-erlang/useless.erl
diff options
context:
space:
mode:
Diffstat (limited to 'learn-you-some-erlang/useless.erl')
-rw-r--r--learn-you-some-erlang/useless.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/learn-you-some-erlang/useless.erl b/learn-you-some-erlang/useless.erl
new file mode 100644
index 0000000..d5542a2
--- /dev/null
+++ b/learn-you-some-erlang/useless.erl
@@ -0,0 +1,14 @@
+-module(useless).
+-export([add/2, hello/0, greet_and_add_two/1]).
+
+add(A,B) ->
+ A + B.
+
+%% Shows greetings.
+%% io:format/1 is the standard function used to output text.
+hello() ->
+ io:format("Hello, world!~n").
+
+greet_and_add_two(X) ->
+ hello(),
+ add(X,2).