case-insensitive-match-0.1.1.0: A simplified, faster way to do case-insensitive matching.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.CaseInsensitive.Eq

Description

This, like most other case-insensitive matching algorithms, is an over-simplification. For some complex Q&A about properties like case, see http://unicode.org/faq/casemap_charprop.html. A round-trip case-conversion does not necessarily result in the original character(s) in some scripts. Also, string matching is not necessarily the same as character matching. The char-at-a-time approach taken here is not technically correct, but works for the most scripts, and definitely for ASCII and the ISO-8859-1 8-bit Latin 1 character set.

Usage is simple:

main = putStrLn $ if "HREF" ^== "href" then "match" else "no match"

Synopsis

Documentation

(^==) :: CaseInsensitiveEq a => a -> a -> Bool

An equality operator for CaseInsensitiveEq.

(^/=) :: CaseInsensitiveEq a => a -> a -> Bool

An inequality operator for CaseInsensitiveEq.