Skip to content

Commit 36bd389

Browse files
authored
Change return type of Intl.Collator.compare to Ordering.t (#8289)
* Change return type of Intl.Collator.compare to Ordering.t * CHANGELOG
1 parent a673a5c commit 36bd389

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#### :boom: Breaking Change
1616

17+
- Change `Intl.Collator.compare` return type from `int` to `Ordering.t` (`float`). https://github.com/rescript-lang/rescript/pull/8289
18+
1719
#### :eyeglasses: Spec Compliance
1820

1921
#### :rocket: New Feature

packages/@rescript/runtime/Stdlib_Intl_Collator.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Intl.Collator.resolvedOptions(collator).locale == "en-US"
7777
7878
```rescript
7979
let collator = Intl.Collator.make(~locales=["en-US"])
80-
collator->Intl.Collator.compare("apple", "banana") < 0
80+
Ordering.isLess(collator->Intl.Collator.compare("apple", "banana"))
8181
```
8282
*/
83-
@send external compare: (t, string, string) => int = "compare"
83+
@send external compare: (t, string, string) => Stdlib_Ordering.t = "compare"
8484

8585
/**
8686
`ignore(collator)` ignores the provided collator and returns unit.

0 commit comments

Comments
 (0)