Proposal for Adding `Order.natural` for Locale-Based String Sorting

I have a question/proposal for an Order.natural that would naturally sort strings using the .compareLocale(). Something like:
export const natrual: Order<string> = make((self, that) => {
  const ord = self.localeCompare(that, undefined, { numeric: true, sensitivity: "base" })
  return ord < 0 ? -1 : ord > 0 ? 1 : 0
}

Have found many occasions where implementing something similar has seemed like a natural primitive to the Order module, but would love to hear opinions on why this should or shouldn't be the case 🤔

Sandbox
Was this page helpful?