From b9d321f91691cf7ea0f2dcb62d6977312e033953 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 11 Mar 2026 13:33:12 +0100 Subject: [PATCH 1/2] Change return type of Intl.Collator.compare to Ordering.t --- packages/@rescript/runtime/Stdlib_Intl_Collator.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@rescript/runtime/Stdlib_Intl_Collator.res b/packages/@rescript/runtime/Stdlib_Intl_Collator.res index 3626e96bc6a..a6d0e4a6d7b 100644 --- a/packages/@rescript/runtime/Stdlib_Intl_Collator.res +++ b/packages/@rescript/runtime/Stdlib_Intl_Collator.res @@ -77,10 +77,10 @@ Intl.Collator.resolvedOptions(collator).locale == "en-US" ```rescript let collator = Intl.Collator.make(~locales=["en-US"]) -collator->Intl.Collator.compare("apple", "banana") < 0 +Ordering.isLess(collator->Intl.Collator.compare("apple", "banana")) ``` */ -@send external compare: (t, string, string) => int = "compare" +@send external compare: (t, string, string) => Stdlib_Ordering.t = "compare" /** `ignore(collator)` ignores the provided collator and returns unit. From 2d779da16a54300e2516159dc6b2a1d6ce4f65bc Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Thu, 12 Mar 2026 08:35:12 +0100 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 475761dad07..aae57b14800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ #### :boom: Breaking Change +- Change `Intl.Collator.compare` return type from `int` to `Ordering.t` (`float`). https://github.com/rescript-lang/rescript/pull/8289 + #### :eyeglasses: Spec Compliance #### :rocket: New Feature