Commits

Fred T-H committed fb50169

discrep file for dialyzer added

  • Participants
  • Parent commits 6725002

Comments (0)

Files changed (1)

+-module(discrep).
+-export([run/0]).
+
+run() ->
+    List = [1,2,3],
+    Res = [compare(X) || X <- List],
+    case lists:all(fun check_small/1, Res) of
+        true ->
+            io:format("All numbers are small!~n");
+        false ->
+            io:format("Not all numbers are small!~n")
+    end.
+
+compare(X) when X < 3 ->
+    small;
+compare(X) when X =:= 3 ->
+    three;
+compare(X) when X > 50 ->
+    very_large;
+compare(X) when X > 3 ->
+    large.
+
+check_small(small) ->
+    true;
+check_small(very_large) ->
+    false;
+check_small(large) ->
+    false.
+