HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecase-insensitive-1.2.1.0Haskell98

Data.CaseInsensitive

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!

  • 1 type
  • 1 class
  • 5 values
datadata 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
Instances11Eq, Data, Ord, Read, Show, IsString, …
  • Eq s => Eq (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • Data s => Data (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • Ord s => Ord (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • (Read s, FoldCase s) => Read (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • Show s => Show (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • (IsString s, FoldCase s) => IsString (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • Semigroup s => Semigroup (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • Monoid s => Monoid (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • NFData s => NFData (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • Hashable s => Hashable (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • FoldCase (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
valuemk :: FoldCase s => s -> CI s
#

Make the given string-like value case insensitive.

valueoriginal :: CI s -> s
#

Retrieve the original string-like value.

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

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

classclass 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

Instances7FoldCase, …
  • FoldCase ByteStringDefined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal

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

  • FoldCase ByteStringDefined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal

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

  • FoldCase CharDefined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • FoldCase TextDefined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • FoldCase TextDefined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • FoldCase (CI s)Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal
  • FoldCase a => FoldCase [a]Defined in case-insensitive-1.2.1.0 · Data.CaseInsensitive.Internal