Copyright | (c) 2011-2013 Bas van Dijk |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |
Safe Haskell | Trustworthy |
Language | Haskell98 |
This module is intended to be imported qualified. May I suggest:
import Data.CaseInsensitive ( CI ) import qualified Data.CaseInsensitive as CI
Note that the FoldCase instance for ByteStrings is only guaranteed to be correct for ISO-8859-1 encoded strings!
Documentation
A
CI s
provides
C
ase
I
nsensitive comparison for the string-like type
s
(for example:
String
,
Text
,
ByteString
, etc.).
Note that
CI s
has an instance for
IsString
which together with the
OverloadedStrings
language extension allows you to write case insensitive
string literals as in:
> ("Content-Type" ::CI
Text
) == ("CONTENT-TYPE" ::CI
Text
) True
Instances
Eq s => Eq ( CI s) Source # | |
Data s => Data ( CI s) Source # | |
Defined in Data.CaseInsensitive.Internal gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> CI s -> c ( CI s) Source # gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ( CI s) Source # toConstr :: CI s -> Constr Source # dataTypeOf :: CI s -> DataType Source # dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ( CI s)) Source # dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ( CI s)) Source # gmapT :: ( forall b. Data b => b -> b) -> CI s -> CI s Source # gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> CI s -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> CI s -> r Source # gmapQ :: ( forall d. Data d => d -> u) -> CI s -> [u] Source # gmapQi :: Int -> ( forall d. Data d => d -> u) -> CI s -> u Source # gmapM :: Monad m => ( forall d. Data d => d -> m d) -> CI s -> m ( CI s) Source # gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> CI s -> m ( CI s) Source # gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> CI s -> m ( CI s) Source # |
|
Ord s => Ord ( CI s) Source # | |
Defined in Data.CaseInsensitive.Internal |
|
( Read s, FoldCase s) => Read ( CI s) Source # | |
Show s => Show ( CI s) Source # | |
( IsString s, FoldCase s) => IsString ( CI s) Source # | |
Defined in Data.CaseInsensitive.Internal fromString :: String -> CI s Source # |
|
Semigroup s => Semigroup ( CI s) Source # | |
Monoid s => Monoid ( CI s) Source # | |
NFData s => NFData ( CI s) Source # | |
Defined in Data.CaseInsensitive.Internal |
|
Hashable s => Hashable ( CI s) Source # | |
FoldCase ( CI s) Source # | |
Defined in Data.CaseInsensitive.Internal |
foldedCase :: CI s -> s Source #
Retrieve the case folded string-like value.
(Also see
foldCase
).
map :: FoldCase s2 => (s1 -> s2) -> CI s1 -> CI s2 Source #
Transform the original string-like value but keep it case insensitive.
traverse :: ( FoldCase s2, Applicative f) => (s1 -> f s2) -> CI s1 -> f ( CI s2) Source #
Transform the original string-like value but keep it case insensitive.
class FoldCase s where Source #
Class of string-like types that support folding cases.
Note
: In some languages, case conversion is a locale- and context-dependent
operation. The
foldCase
method is
not
intended to be locale sensitive.
Programs that require locale sensitivity should use appropriate versions of
the case mapping functions from the
text-icu
package:
http://hackage.haskell.org/package/text-icu
Instances
FoldCase Char Source # | |
Defined in Data.CaseInsensitive.Internal |
|
FoldCase ByteString Source # |
Note that
|
Defined in Data.CaseInsensitive.Internal foldCase :: ByteString -> ByteString Source # foldCaseList :: [ ByteString ] -> [ ByteString ] |
|
FoldCase ByteString Source # |
Note that
|
Defined in Data.CaseInsensitive.Internal foldCase :: ByteString -> ByteString Source # foldCaseList :: [ ByteString ] -> [ ByteString ] |
|
FoldCase Text Source # | |
Defined in Data.CaseInsensitive.Internal |
|
FoldCase Text Source # | |
Defined in Data.CaseInsensitive.Internal |
|
FoldCase a => FoldCase [a] Source # | |
Defined in Data.CaseInsensitive.Internal foldCase :: [a] -> [a] Source # foldCaseList :: [[a]] -> [[a]] |
|
FoldCase ( CI s) Source # | |
Defined in Data.CaseInsensitive.Internal |