From 423405fd48201b4a229c78f4a3bc8add1b879fb2 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 17 Jun 2025 09:35:45 +0200 Subject: [PATCH] Add docstrings for StdLib_Bool --- runtime/Stdlib_Bool.resi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/runtime/Stdlib_Bool.resi b/runtime/Stdlib_Bool.resi index 718c944e7e..f5f3bcea4b 100644 --- a/runtime/Stdlib_Bool.resi +++ b/runtime/Stdlib_Bool.resi @@ -65,6 +65,28 @@ switch Bool.fromStringExn("notAValidBoolean") { @deprecated("Use `fromStringOrThrow` instead") let fromStringExn: string => bool +/** +Compares two booleans, returns an `Ordering.t` value. + +## Examples +```rescript +Bool.compare(true, true)->assertEqual(Ordering.equal) +Bool.compare(false, false)->assertEqual(Ordering.equal) +Bool.compare(true, false)->assertEqual(Ordering.greater) +Bool.compare(false, true)->assertEqual(Ordering.less) +``` +*/ external compare: (bool, bool) => Stdlib_Ordering.t = "%compare" +/** +Checks if two booleans are equal and have the same value. + +## Examples +```rescript +Bool.equal(true, true)->assertEqual(true) +Bool.equal(false, false)->assertEqual(true) +Bool.equal(true, false)->assertEqual(false) +Bool.equal(false, true)->assertEqual(false) +``` +*/ external equal: (bool, bool) => bool = "%equal"