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

Modulecharset-0.3.12Haskell2010

Data.CharSet

A CharSet is an efficient representation of a set of Char values designed for fast membership tests.

As an example build isAlpha will create a set of alphabetic characters. We can then use member on the generated set to efficiently test if a given Char represents an alphabetic character.

Designed to be imported qualified:

import Data.CharSet (CharSet)
import qualified Data.CharSet as CharSet
  • 1 type
  • 31 values
  • Packagecharset-0.3.12
  • Exports32
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCharSet.hs

Set type

1 declaration
datadata CharSet
#

Stored as a (possibly negated) IntSet and a fast set used for the head byte.

The set of valid (possibly negated) head bytes is stored unboxed as a 32-byte bytestring-based lookup table.

Constructors

Instances9Bounded, Eq, Data, Ord, Read, Show, …

Operators

1 declaration

Query

7 declarations

Construction

8 declarations
valuebuild :: (Char -> Bool) -> CharSet
#

Applies a predicate across the whole range of possible character values to create a set of only those characters which satisfy the predicate.

As an example build isAlpha will generate a CharSet of all alphabetic characters.

Combine

3 declarations

Filter

2 declarations

Map

1 declaration

Fold

1 declaration

Conversion

0 declarations

List

Ordered list

IntMaps

Array