diff options
-rw-r--r-- | src/gleam/bool.gleam | 8 | ||||
-rw-r--r-- | src/gleam/result.gleam | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam index e016168..22d0663 100644 --- a/src/gleam/bool.gleam +++ b/src/gleam/bool.gleam @@ -1,3 +1,11 @@ +//// A type with two possible values, True and False. Used to indicate whether +//// things are... true or false! +//// +//// Often is it clearer and offers more type safety to define a custom type +//// than to use Bool. For example, rather than having a `is_teacher: Bool` +//// field consider having a `role: SchoolRole` field where SchoolRole is a custom +//// type that can be either Student or Teacher. + import gleam/order.{Order} /// Returns the opposite bool value. diff --git a/src/gleam/result.gleam b/src/gleam/result.gleam index cbc2f0b..01c5510 100644 --- a/src/gleam/result.gleam +++ b/src/gleam/result.gleam @@ -1,3 +1,6 @@ +//// Result represents the result of something that may succeed or not. +//// `Ok` means it was successful, `Error` means it was not successful. + import gleam/list /// Checks whether the result is an Ok value. |