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


-- | Normalization insensitive string comparison
--   
--   The module <tt>Data.Unicode.NormalizationInsensitive</tt> provides the
--   <a>NI</a> type constructor which can be parameterized by a string-like
--   type like: <a>String</a>, <a>ByteString</a>, <a>Text</a>, etc..
--   Comparisons of values of the resulting type will be insensitive to
--   normalization. This is very similar in spirit to the
--   <tt>case-insensitive</tt> package, and is in fact based on the same
--   code.
@package normalization-insensitive
@version 2.0.1


-- | This module is intended to be imported qualified. May I suggest:
--   
--   <pre>
--   import           Data.Unicode.NormalizationInsensitive  ( NI )
--   import qualified Data.Unicode.NormalizationInsensitive as NI
--   </pre>
module Data.Unicode.NormalizationInsensitive

-- | A <tt>NI s</tt> provides <i>N</i>ormalization <i>I</i>nsensitive
--   comparison for the string-like type <tt>s</tt> (for example:
--   <a>String</a>, <a>Text</a>, <a>ByteString</a>, etc.).
--   
--   Note that <tt>NI s</tt> has an instance for <a>IsString</a> which
--   together with the <tt>OverloadedStrings</tt> language extension allows
--   you to write normalization insensitive string literals as in:
--   
--   <pre>
--   &gt; ("\12399\12441" :: NI Text) == ("\12400" :: NI Text)
--   True
--   </pre>
data NI s

-- | Make the given string-like value normalization insensitive.
mk :: Normalizable s => s -> NI s

-- | Retrieve the original string-like value.
original :: NI s -> s

-- | Retrieve the normalized string-like value. (Also see
--   <a>normalize</a>).
normalized :: NI s -> s

-- | Transform the original string-like value but keep it normalized.
map :: Normalizable s2 => (s1 -> s2) -> (NI s1 -> NI s2)

-- | Class of string-like types that support normalization.
class Normalizable s
normalize :: Normalizable s => s -> s


-- | Provides an unsafe way to create a normalization insensitive
--   string-like value.
module Data.Unicode.NormalizationInsensitive.Unsafe

-- | Constructs an <a>NI</a> from an already normalized string-like value.
--   The given string is used both as the <a>original</a> as well as the
--   <a>normalized</a>.
--   
--   This function is unsafe since the compiler can't guarantee that the
--   provided string is normalized.
unsafeMk :: s -> NI s
