aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gleam/bool.gleam17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam
index 92706bf..6728d00 100644
--- a/src/gleam/bool.gleam
+++ b/src/gleam/bool.gleam
@@ -200,3 +200,20 @@ pub fn to_int(bool: Bool) -> Int {
True -> 1
}
}
+
+/// Returns a string representation of the given bool.
+///
+/// ## Examples
+///
+/// > to_string(True)
+/// "True"
+///
+/// > to_string(False)
+/// "False"
+///
+pub fn to_string(bool: Bool) -> String {
+ case bool {
+ False -> "False"
+ True -> "True"
+ }
+}