diff options
author | Louis Pilfold <louis@lpil.uk> | 2024-12-10 14:36:58 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-12-10 14:36:58 +0000 |
commit | f15d41b5087d286b4862e2d5dea5382961daef55 (patch) | |
tree | e130ddc91dec73c8839e603a5fbebd5aef9d0f96 | |
parent | 370a060299cc9aeca4b37c3a36ce392055599815 (diff) | |
download | gleam_stdlib-0.47.0.tar.gz gleam_stdlib-0.47.0.zip |
v0.47.0v0.47.0
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | gleam.toml | 2 | ||||
-rw-r--r-- | src/gleam/bool.gleam | 27 |
3 files changed, 8 insertions, 26 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f0a014..8122997 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v0.47.0 - 2024-12-10 + +- The `compare` and `to_string` functions from the `gleam/bool` module have been + deprecated. + ## v0.46.0 - 2024-12-08 - Improved the performance of comparing two `Dict`s of equal size on the @@ -1,5 +1,5 @@ name = "gleam_stdlib" -version = "0.46.0" +version = "0.47.0" gleam = ">= 0.32.0" licences = ["Apache-2.0"] description = "A standard library for the Gleam programming language" diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam index ced8005..6c14d68 100644 --- a/src/gleam/bool.gleam +++ b/src/gleam/bool.gleam @@ -192,17 +192,7 @@ pub fn exclusive_nor(a: Bool, b: Bool) -> Bool { a == b } -/// Compares two bools and returns the first value's `Order` to the second. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/order -/// -/// compare(True, False) -/// // -> order.Gt -/// ``` -/// +@deprecated("Please use a case expression to get the behaviour you desire") pub fn compare(a: Bool, with b: Bool) -> Order { case a, b { True, True -> order.Eq @@ -212,20 +202,7 @@ pub fn compare(a: Bool, with b: Bool) -> Order { } } -/// Returns a numeric representation of the given bool. -/// -/// ## Examples -/// -/// ```gleam -/// to_int(True) -/// // -> 1 -/// ``` -/// -/// ```gleam -/// to_int(False) -/// // -> 0 -/// ``` -/// +@deprecated("Please use a case expression to get the behaviour you desire") pub fn to_int(bool: Bool) -> Int { case bool { False -> 0 |