From 035d0437c0523f5a509140b370411c8a76c33788 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Wed, 21 Jul 2021 21:19:58 +0200 Subject: Restore Result and Bool module comments --- src/gleam/bool.gleam | 8 ++++++++ src/gleam/result.gleam | 3 +++ 2 files changed, 11 insertions(+) (limited to 'src') 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. -- cgit v1.2.3