diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/bool.gleam | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam index 707d295..0aa9939 100644 --- a/src/gleam/bool.gleam +++ b/src/gleam/bool.gleam @@ -55,6 +55,31 @@ pub fn nor(a: Bool, b: Bool) -> Bool { } } +/// Returns the nand of two bools +/// +/// ## Examples +/// +/// > nor(False, False) +/// True +/// +/// > nor(False, True) +/// True +/// +/// > nor(True, False) +/// True +/// +/// > nor(True, True) +/// False +/// +pub fn nand(a: Bool, b: Bool) -> Bool { + case a, b { + False, False -> True + False, True -> True + True, False -> True + True, True -> False + } +} + /// Returns the exclusive or of two bools /// /// ## Examples |