case-insensitive-0.1: Case insensitive string comparison

MaintainerBas van Dijk <>



This module is intended to be imported qualified. May I suggest:

 import          Data.CaseInsensitive   ( CI )
 import qualifed Data.CaseInsensitivee as CI



data CI s Source

A CI s provides Case Insensitive comparison for the string-like type s (for example: String, Text, ByteString, ShowS, 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)


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) 
Monoid s => Monoid (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.

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.

For Char this means toLower and for Text this means toCaseFold.


foldCase :: s -> sSource