aboutsummaryrefslogtreecommitdiff
path: root/gen/src/std@bool.erl
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-05-29 21:02:55 +0100
committerLouis Pilfold <louis@lpil.uk>2019-06-02 21:12:59 +0100
commit5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31 (patch)
tree5d0d281c66cf71c6e3ca880e6621138a71b95e7b /gen/src/std@bool.erl
parentee03f5a0465e176e220060164a5ffc408f73ed0d (diff)
downloadgleam_stdlib-5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31.tar.gz
gleam_stdlib-5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31.zip
Enable namespaced modules
Diffstat (limited to 'gen/src/std@bool.erl')
-rw-r--r--gen/src/std@bool.erl55
1 files changed, 55 insertions, 0 deletions
diff --git a/gen/src/std@bool.erl b/gen/src/std@bool.erl
new file mode 100644
index 0000000..c77a2d8
--- /dev/null
+++ b/gen/src/std@bool.erl
@@ -0,0 +1,55 @@
+-module(std@bool).
+-compile(no_auto_import).
+
+-export([negate/1, compare/2, max/2, min/2, to_int/1]).
+
+negate(Bool) ->
+ case Bool of
+ true ->
+ false;
+
+ false ->
+ true
+ end.
+
+compare(A, B) ->
+ case {A, B} of
+ {true, true} ->
+ eq;
+
+ {true, false} ->
+ gt;
+
+ {false, false} ->
+ eq;
+
+ {false, true} ->
+ lt
+ end.
+
+max(A, B) ->
+ case A of
+ true ->
+ true;
+
+ false ->
+ B
+ end.
+
+min(A, B) ->
+ case A of
+ false ->
+ false;
+
+ true ->
+ B
+ end.
+
+to_int(Bool) ->
+ case Bool of
+ false ->
+ 0;
+
+ true ->
+ 1
+ end.