Skip to content

Commit f15d41b

Browse files
committed
v0.47.0
1 parent 370a060 commit f15d41b

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v0.47.0 - 2024-12-10
4+
5+
- The `compare` and `to_string` functions from the `gleam/bool` module have been
6+
deprecated.
7+
38
## v0.46.0 - 2024-12-08
49

510
- Improved the performance of comparing two `Dict`s of equal size on the

gleam.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "gleam_stdlib"
2-
version = "0.46.0"
2+
version = "0.47.0"
33
gleam = ">= 0.32.0"
44
licences = ["Apache-2.0"]
55
description = "A standard library for the Gleam programming language"

src/gleam/bool.gleam

+2-25
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,7 @@ pub fn exclusive_nor(a: Bool, b: Bool) -> Bool {
192192
a == b
193193
}
194194

195-
/// Compares two bools and returns the first value's `Order` to the second.
196-
///
197-
/// ## Examples
198-
///
199-
/// ```gleam
200-
/// import gleam/order
201-
///
202-
/// compare(True, False)
203-
/// // -> order.Gt
204-
/// ```
205-
///
195+
@deprecated("Please use a case expression to get the behaviour you desire")
206196
pub fn compare(a: Bool, with b: Bool) -> Order {
207197
case a, b {
208198
True, True -> order.Eq
@@ -212,20 +202,7 @@ pub fn compare(a: Bool, with b: Bool) -> Order {
212202
}
213203
}
214204

215-
/// Returns a numeric representation of the given bool.
216-
///
217-
/// ## Examples
218-
///
219-
/// ```gleam
220-
/// to_int(True)
221-
/// // -> 1
222-
/// ```
223-
///
224-
/// ```gleam
225-
/// to_int(False)
226-
/// // -> 0
227-
/// ```
228-
///
205+
@deprecated("Please use a case expression to get the behaviour you desire")
229206
pub fn to_int(bool: Bool) -> Int {
230207
case bool {
231208
False -> 0

0 commit comments

Comments
 (0)