case-insensitive-1.2.0.11: Case insensitive string comparison

Copyright(c) 2011-2013 Bas van Dijk
LicenseBSD-style (see the file LICENSE)
MaintainerBas van Dijk <v.dijk.bas@gmail.com>
Safe HaskellTrustworthy
LanguageHaskell98

Data.CaseInsensitive

Description

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!

Synopsis

Documentation

data CI s #

A CI s provides Case Insensitive 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) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

(==) :: CI s -> CI s -> Bool #

(/=) :: CI s -> CI s -> Bool #

Data s => Data (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

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

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

toConstr :: CI s -> Constr #

dataTypeOf :: CI s -> DataType #

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

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

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

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

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

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

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

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

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

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

Ord s => Ord (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

compare :: CI s -> CI s -> Ordering #

(<) :: CI s -> CI s -> Bool #

(<=) :: CI s -> CI s -> Bool #

(>) :: CI s -> CI s -> Bool #

(>=) :: CI s -> CI s -> Bool #

max :: CI s -> CI s -> CI s #

min :: CI s -> CI s -> CI s #

(Read s, FoldCase s) => Read (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Show s => Show (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

showsPrec :: Int -> CI s -> ShowS #

show :: CI s -> String #

showList :: [CI s] -> ShowS #

(IsString s, FoldCase s) => IsString (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

fromString :: String -> CI s #

Semigroup s => Semigroup (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

(<>) :: CI s -> CI s -> CI s #

sconcat :: NonEmpty (CI s) -> CI s #

stimes :: Integral b => b -> CI s -> CI s #

Monoid s => Monoid (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

mempty :: CI s #

mappend :: CI s -> CI s -> CI s #

mconcat :: [CI s] -> CI s #

NFData s => NFData (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

rnf :: CI s -> () #

Hashable s => Hashable (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

hashWithSalt :: Int -> CI s -> Int #

hash :: CI s -> Int #

FoldCase (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

foldCase :: CI s -> CI s #

foldCaseList :: [CI s] -> [CI s]

mk :: FoldCase s => s -> CI s #

Make the given string-like value case insensitive.

original :: CI s -> s #

Retrieve the original string-like value.

foldedCase :: CI s -> s #

Retrieve the case folded string-like value. (Also see foldCase).

map :: FoldCase s2 => (s1 -> s2) -> CI s1 -> CI s2 #

Transform the original string-like value but keep it case insensitive.

class FoldCase s where #

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

Methods

foldCase :: s -> s #

Instances
FoldCase Char # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

foldCase :: Char -> Char #

foldCaseList :: [Char] -> [Char]

FoldCase ByteString #

Note that foldCase on ByteStrings is only guaranteed to be correct for ISO-8859-1 encoded strings!

Instance details

Defined in Data.CaseInsensitive.Internal

FoldCase ByteString #

Note that foldCase on ByteStrings is only guaranteed to be correct for ISO-8859-1 encoded strings!

Instance details

Defined in Data.CaseInsensitive.Internal

FoldCase Text # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

foldCase :: Text -> Text #

foldCaseList :: [Text] -> [Text]

FoldCase Text # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

foldCase :: Text -> Text #

foldCaseList :: [Text] -> [Text]

FoldCase a => FoldCase [a] # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

foldCase :: [a] -> [a] #

foldCaseList :: [[a]] -> [[a]]

FoldCase (CI s) # 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

foldCase :: CI s -> CI s #

foldCaseList :: [CI s] -> [CI s]