From 6b34f8b616d4ec169ebf8d1e5a26d78ceebc8a59 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 19 Apr 2020 22:12:15 +0100 Subject: Document Bool type --- src/gleam/bool.gleam | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam index 8dcc614..a1c7ede 100644 --- a/src/gleam/bool.gleam +++ b/src/gleam/bool.gleam @@ -1,7 +1,13 @@ -/// A set of utility functions for working with `Bool` values. - import gleam/order.{Order} +/// 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. +/// pub type Bool = Bool -- cgit v1.2.3