-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | User-friendly text collation
--   
--   The built-in comparisons for textual data are based on Unicode
--   ordinals. This does not match most every-day sorting algorithms. For
--   example, "z10.txt" is sorted after "z2.txt" by users, but before it by
--   naïve algorithms.
--   
--   This package provides an implementation of "natural sort", which more
--   closely matches user expectations.
--   
--   See also: <a>http://www.davekoelle.com/alphanum.html</a>
@package natural-sort
@version 0.1.2


-- | Human-friendly text collation
module Algorithms.NaturalSort
data SortKey
class NaturalSort a

-- | 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 <a>toLower</a>) or use <a>sortKeyCollated</a>.
sortKey :: NaturalSort a => a -> SortKey

-- | Split a sortable type into textual and numeric sections, using a
--   custom collation transformation. This is useful for providing
--   language- or use-specific ordering.
sortKeyCollated :: NaturalSort a => (Text -> ByteString) -> a -> SortKey

-- | Compare two values, using their natural ordering.
compare :: NaturalSort a => a -> a -> Ordering
instance GHC.Classes.Ord Algorithms.NaturalSort.SortKey
instance GHC.Classes.Eq Algorithms.NaturalSort.SortKey
instance GHC.Show.Show Algorithms.NaturalSort.SortKey
instance Algorithms.NaturalSort.NaturalSort GHC.Base.String
instance Algorithms.NaturalSort.NaturalSort Data.Text.Internal.Lazy.Text
instance Algorithms.NaturalSort.NaturalSort Data.Text.Internal.Text
instance GHC.Show.Show Algorithms.NaturalSort.SortChunk
instance GHC.Classes.Ord Algorithms.NaturalSort.SortChunk
instance GHC.Classes.Eq Algorithms.NaturalSort.SortChunk
