Package: effect
Module: Order
Order instance for strings that compares them lexicographically using JavaScript’s < operator.
When to use
Use when you need lexicographic string ordering.
Details
Uses lexicographic dictionary ordering. The empty string is less than any non-empty string, and comparisons are case-sensitive.
Example (Ordering strings)
import { Order } from "effect"
console.log(Order.String("apple", "banana")) // -1
console.log(Order.String("banana", "apple")) // 1
console.log(Order.String("apple", "apple")) // 0
See
mapInput to compare objects by a string propertyStruct to combine with other orders for struct comparisonSignature
declare const String: Order<string>
Since v4.0.0