normalization-insensitive-2.0.0.1: Normalization insensitive string comparison

Copyright(c) 2011-2013 Bas van Dijk, (c) 2016 Patrick Pelletier
LicenseBSD-style (see the file LICENSE)
MaintainerPatrick Pelletier <code@funwithsoftware.org>
Safe HaskellTrustworthy
LanguageHaskell98

Data.Unicode.NormalizationInsensitive

Description

This module is intended to be imported qualified. May I suggest:

import           Data.Unicode.NormalizationInsensitive  ( NI )
import qualified Data.Unicode.NormalizationInsensitive as NI

Synopsis

Documentation

data NI s Source

A NI s provides Normalization Insensitive comparison for the string-like type s (for example: String, Text, ByteString, etc.).

Note that NI s has an instance for IsString which together with the OverloadedStrings language extension allows you to write normalization insensitive string literals as in:

> ("\12399\12441" :: NI Text) == ("\12400" :: NI Text)
True

Instances

Eq s => Eq (NI s) 
Data s => Data (NI s) 
Ord s => Ord (NI s) 
(Read s, Normalizable s) => Read (NI s) 
Show s => Show (NI s) 
(IsString s, Normalizable s) => IsString (NI s) 
(Monoid s, Normalizable s) => Monoid (NI s) 
NFData s => NFData (NI s) 
Hashable s => Hashable (NI s) 
Normalizable (NI s) 
Typeable (* -> *) NI 

mk :: Normalizable s => s -> NI s Source

Make the given string-like value normalization insensitive.

original :: NI s -> s Source

Retrieve the original string-like value.

map :: Normalizable s2 => (s1 -> s2) -> NI s1 -> NI s2 Source

Transform the original string-like value but keep it normalized.

class Normalizable s where Source

Class of string-like types that support normalization.

Methods

normalize :: s -> s Source

Instances

Normalizable String 
Normalizable ByteString

Note that normalize on ByteStrings assumes UTF-8 encoded strings!

Normalizable ByteString

Note that normalize on ByteStrings assumes UTF-8 encoded strings!

Normalizable Text 
Normalizable Text 
Normalizable (NI s)