Copyright | (c) 2011-2013 Bas van Dijk (c) 2016 Patrick Pelletier |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Patrick Pelletier <code@funwithsoftware.org> |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
This module is intended to be imported qualified. May I suggest:
import Data.Unicode.NormalizationInsensitive ( NI ) import qualified Data.Unicode.NormalizationInsensitive as NI
Synopsis
- data NI s
- mk :: Normalizable s => s -> NI s
- original :: NI s -> s
- normalized :: NI s -> s
- map :: Normalizable s2 => (s1 -> s2) -> NI s1 -> NI s2
- class Normalizable s where
- normalize :: s -> s
Documentation
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) Source # | |
Data s => Data (NI s) Source # | |
Defined in Data.Unicode.NormalizationInsensitive.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NI s -> c (NI s) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NI s) # dataTypeOf :: NI s -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NI s)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NI s)) # gmapT :: (forall b. Data b => b -> b) -> NI s -> NI s # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NI s -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NI s -> r # gmapQ :: (forall d. Data d => d -> u) -> NI s -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NI s -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NI s -> m (NI s) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NI s -> m (NI s) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NI s -> m (NI s) # | |
Ord s => Ord (NI s) Source # | |
(Read s, Normalizable s) => Read (NI s) Source # | |
Show s => Show (NI s) Source # | |
(IsString s, Normalizable s) => IsString (NI s) Source # | |
Defined in Data.Unicode.NormalizationInsensitive.Internal fromString :: String -> NI s # | |
(Semigroup s, Normalizable s) => Semigroup (NI s) Source # | |
(Monoid s, Normalizable s) => Monoid (NI s) Source # | |
NFData s => NFData (NI s) Source # | |
Hashable s => Hashable (NI s) Source # | |
Normalizable (NI s) Source # | |
mk :: Normalizable s => s -> NI s Source #
Make the given string-like value normalization insensitive.
normalized :: NI s -> s Source #
Retrieve the normalized string-like value.
(Also see normalize
).
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.
Instances
Normalizable String Source # | |
Normalizable ByteString Source # | Note that |
Defined in Data.Unicode.NormalizationInsensitive.Internal normalize :: ByteString -> ByteString Source # | |
Normalizable ByteString Source # | Note that |
Defined in Data.Unicode.NormalizationInsensitive.Internal normalize :: ByteString -> ByteString Source # | |
Normalizable Text Source # | |
Normalizable Text Source # | |
Normalizable (NI s) Source # | |