text-icu-normalized-0.4.1: Dealing with Strict Text in NFC normalization.

Copyright©2016
LicenseGPL-3
MaintainerEvan Cofsky <evan@theunixman.com>
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Data.Text.ICU.Normalized.NFC

Description

This will perform the NFC pass on any Text to ensure it's in a Normalized form to prevent subtle text-based bugs.

Provides Ord and Eq based on uca. Also derives Generic and Typeable for other packages to use.

Synopsis

Documentation

data NFCText Source #

An NFC-normalized Data.Text

Instances

Eq NFCText Source #

If the Ord of the two texts is EQ, then they're equal.

Methods

(==) :: NFCText -> NFCText -> Bool #

(/=) :: NFCText -> NFCText -> Bool #

Data NFCText Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NFCText -> c NFCText #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NFCText #

toConstr :: NFCText -> Constr #

dataTypeOf :: NFCText -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c NFCText) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NFCText) #

gmapT :: (forall b. Data b => b -> b) -> NFCText -> NFCText #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NFCText -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NFCText -> r #

gmapQ :: (forall d. Data d => d -> u) -> NFCText -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NFCText -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NFCText -> m NFCText #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NFCText -> m NFCText #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NFCText -> m NFCText #

Ord NFCText Source #

Since we're NFC, we satisfy FCD, and we can just compare directly.

Show NFCText Source # 
Generic NFCText Source # 

Associated Types

type Rep NFCText :: * -> * #

Methods

from :: NFCText -> Rep NFCText x #

to :: Rep NFCText x -> NFCText #

IsText NFCText Source # 
type Rep NFCText Source # 
type Rep NFCText = D1 (MetaData "NFCText" "Data.Text.ICU.Normalized.NFC" "text-icu-normalized-0.4.1-KPzrzXg6X5BI1u3u9P4hdT" True) (C1 (MetaCons "NFCText" PrefixI True) (S1 (MetaSel (Just Symbol "unNFC") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

packed :: IsText t => Iso' String t #

This isomorphism can be used to pack (or unpack) strict or lazy Text.

pack x ≡ x ^. packed
unpack x ≡ x ^. from packed
packedfrom unpacked

builder :: IsText t => Iso' t Builder #

Convert between strict or lazy Text and a Builder.

fromText x ≡ x ^. builder

text :: IsText t => IndexedTraversal' Int t Char #

Traverse the individual characters in strict or lazy Text.

text = unpacked . traversed

normalized :: IsText t => Iso' NFCText t Source #

Iso between an IsText and an NFCText.