From 8fb5ad85ab623f93cfc0670bc11ec12856a9b4cd Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Fri, 10 May 2019 14:31:53 +0100 Subject: bool:compare --- src/bool.gleam | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/bool.gleam b/src/bool.gleam index 46cca60..f954897 100644 --- a/src/bool.gleam +++ b/src/bool.gleam @@ -1,4 +1,4 @@ -// import order +import order pub fn negate(bool) { case bool { @@ -7,14 +7,14 @@ pub fn negate(bool) { } } -// pub fn compare(a, b) { -// case {a, b} { -// | {True, True} -> order:Eq -// | {True, False} -> order:Gt -// | {False, False} -> order:Eq -// | {False, True} -> order:Lt -// } -// } +pub fn compare(a, b) { + case {a, b} { + | {True, True} -> order:Eq + | {True, False} -> order:Gt + | {False, False} -> order:Eq + | {False, True} -> order:Lt + } +} pub fn max(a, b) { case a { -- cgit v1.2.3