natural-sort-0.1: User-friendly text collation

Portabilityportable
Maintainerjmillikin@gmail.com

Algorithms.NaturalSort

Description

Human-friendly text collation

Synopsis

Documentation

class NaturalSort a whereSource

Methods

sortKey :: a -> SortKeySource

Split a sortable type into textual and numeric sections, with no collation transformation.

If advanced collation is required, either pre-transform the input (using eg toLower) or use sortKeyCollated.

sortKeyCollated :: (Text -> ByteString) -> a -> SortKeySource

Split a sortable type into textual and numeric sections, using a custom collation transformation. This is useful for providing language- or use-specific ordering.

compare :: NaturalSort a => a -> a -> OrderingSource

Compare two values, using their natural ordering.