case-insensitive-1.0.0.1: Case insensitive string comparison

MaintainerBas van Dijk <v.dijk.bas@gmail.com>
Safe HaskellTrustworthy

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 Source

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

Typeable1 CI 
Eq s => Eq (CI s) 
Ord s => Ord (CI s) 
(Read s, FoldCase s) => Read (CI s) 
Show s => Show (CI s) 
(IsString s, FoldCase s) => IsString (CI s) 
Hashable s => Hashable (CI s) 
Monoid s => Monoid (CI s) 
NFData s => NFData (CI s) 
FoldCase (CI s) 

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

Make the given string-like value case insensitive.

original :: CI s -> sSource

Retrieve the original string-like value.

foldedCase :: CI s -> sSource

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

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

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

class FoldCase s whereSource

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 -> sSource

Instances

FoldCase Char 
FoldCase ByteString

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

FoldCase ByteString

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

FoldCase Text 
FoldCase Text 
FoldCase a => FoldCase [a] 
FoldCase (CI s)